Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
ZKAPAuthorizer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Administrator
ZKAPAuthorizer
Commits
4b4978ac
Commit
4b4978ac
authored
5 years ago
by
Jean-Paul Calderone
Browse files
Options
Downloads
Patches
Plain Diff
Replace "PaymentReferenceNumber" with "Voucher".
parent
81b22bdd
Branches
Branches containing commit
No related tags found
1 merge request
!16
Rename "Payment Reference Numbers"
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/_secureaccesstokenauthorizer/resource.py
+2
-2
2 additions, 2 deletions
src/_secureaccesstokenauthorizer/resource.py
src/_secureaccesstokenauthorizer/tests/test_client_resource.py
+13
-14
13 additions, 14 deletions
...secureaccesstokenauthorizer/tests/test_client_resource.py
with
15 additions
and
16 deletions
src/_secureaccesstokenauthorizer/resource.py
+
2
−
2
View file @
4b4978ac
...
...
@@ -69,7 +69,7 @@ def from_configuration(node_config, store=None):
root
=
Resource
()
root
.
putChild
(
b
"
voucher
"
,
_
PaymentReferenceNumb
erCollection
(
_
Vouch
erCollection
(
store
,
controller
,
),
...
...
@@ -77,7 +77,7 @@ def from_configuration(node_config, store=None):
return
root
class
_
PaymentReferenceNumb
erCollection
(
Resource
):
class
_
Vouch
erCollection
(
Resource
):
"""
This class implements redemption of vouchers. Users **PUT** such numbers
to this resource which delegates redemption responsibilities to the
...
...
This diff is collapsed.
Click to expand it.
src/_secureaccesstokenauthorizer/tests/test_client_resource.py
+
13
−
14
View file @
4b4978ac
...
...
@@ -205,14 +205,14 @@ def root_from_config(config):
)
class
PaymentReferenceNumb
erTests
(
TestCase
):
class
Vouch
erTests
(
TestCase
):
"""
Tests relating to ``/voucher`` as implemented by the
``_secureaccesstokenauthorizer.resource`` module and its handling of
vouchers.
"""
def
setUp
(
self
):
super
(
PaymentReferenceNumb
erTests
,
self
).
setUp
()
super
(
Vouch
erTests
,
self
).
setUp
()
self
.
useFixture
(
CaptureTwistedLogs
())
...
...
@@ -234,9 +234,9 @@ class PaymentReferenceNumberTests(TestCase):
@given
(
tahoe_configs_with_client_config
,
vouchers
())
def
test_put_prn
(
self
,
get_config
,
prn
):
"""
When a voucher is ``PUT`` to ``
PaymentReferenceNumb
erCollection`` it is
passed in to the
redemption model object for handling and an ``OK``
response is
returned.
When a voucher is ``PUT`` to ``
Vouch
erCollection`` it is
passed in to the
redemption model object for handling and an ``OK``
response is
returned.
"""
tempdir
=
self
.
useFixture
(
TempDir
())
config
=
get_config
(
tempdir
.
join
(
b
"
tahoe
"
),
b
"
tub.port
"
)
...
...
@@ -265,9 +265,9 @@ class PaymentReferenceNumberTests(TestCase):
@given
(
tahoe_configs_with_client_config
,
invalid_bodies
())
def
test_put_invalid_body
(
self
,
get_config
,
body
):
"""
If the body of a ``PUT`` to ``
PaymentReferenceNumb
erCollection`` does not
consist of an
object with a single *voucher* property then the
response is *BAD
REQUEST*.
If the body of a ``PUT`` to ``
Vouch
erCollection`` does not
consist of an
object with a single *voucher* property then the
response is *BAD
REQUEST*.
"""
tempdir
=
self
.
useFixture
(
TempDir
())
config
=
get_config
(
tempdir
.
join
(
b
"
tahoe
"
),
b
"
tub.port
"
)
...
...
@@ -297,8 +297,7 @@ class PaymentReferenceNumberTests(TestCase):
def
test_get_invalid_prn
(
self
,
get_config
,
not_prn
):
"""
When a syntactically invalid voucher is requested with a ``GET`` to a
child of ``PaymentReferenceNumberCollection`` the response is **BAD
REQUEST**.
child of ``VoucherCollection`` the response is **BAD REQUEST**.
"""
tempdir
=
self
.
useFixture
(
TempDir
())
config
=
get_config
(
tempdir
.
join
(
b
"
tahoe
"
),
b
"
tub.port
"
)
...
...
@@ -326,8 +325,8 @@ class PaymentReferenceNumberTests(TestCase):
def
test_get_unknown_prn
(
self
,
get_config
,
prn
):
"""
When a voucher is requested with a ``GET`` to a child of
``
PaymentReferenceNumb
erCollection`` the response is **NOT FOUND** if
the voucher
hasn
'
t previously been submitted with a ``PUT``.
``
Vouch
erCollection`` the response is **NOT FOUND** if
the voucher
hasn
'
t previously been submitted with a ``PUT``.
"""
tempdir
=
self
.
useFixture
(
TempDir
())
config
=
get_config
(
tempdir
.
join
(
b
"
tahoe
"
),
b
"
tub.port
"
)
...
...
@@ -404,8 +403,8 @@ class PaymentReferenceNumberTests(TestCase):
@given
(
tahoe_configs_with_client_config
,
lists
(
vouchers
(),
unique
=
True
))
def
test_list_prns
(
self
,
get_config
,
prns
):
"""
A ``GET`` to the ``
PaymentReferenceNumb
erCollection`` itself returns a
list of existing
vouchers.
A ``GET`` to the ``
Vouch
erCollection`` itself returns a
list of existing
vouchers.
"""
# Hypothesis causes our test case instances to be re-used many times
# between setUp and tearDown. Avoid re-using the same temporary
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment