diff --git a/src/_secureaccesstokenauthorizer/resource.py b/src/_secureaccesstokenauthorizer/resource.py index d8b3626e862d35dbb034345344af368ebbb947cf..f1e59d8e9f4752ccb7b31c8653570dc50d18d347 100644 --- a/src/_secureaccesstokenauthorizer/resource.py +++ b/src/_secureaccesstokenauthorizer/resource.py @@ -79,11 +79,11 @@ def from_configuration(node_config, store=None): class _PaymentReferenceNumberCollection(Resource): """ - This class implements redemption of payment reference numbers (PRNs). - Users **PUT** such numbers to this resource which delegates redemption + This class implements redemption of payment reference numbers. Users + **PUT** such numbers to this resource which delegates redemption responsibilities to the redemption controller. Child resources of this resource can also be retrieved to monitor the status of previously - submitted PRNs. + submitted vouchers. """ def __init__(self, store, controller): self._store = store @@ -93,7 +93,7 @@ class _PaymentReferenceNumberCollection(Resource): def render_PUT(self, request): """ - Record a PRN and begin attempting to redeem it. + Record a voucher and begin attempting to redeem it. """ try: payload = loads(request.content.read()) @@ -137,9 +137,9 @@ def is_syntactic_prn(prn): :return bool: ``True`` if and only if ``prn`` is a unicode string containing a syntactically valid payment reference number. This says - **nothing** about the validity of the represented PRN itself. A + **nothing** about the validity of the represented voucher itself. A ``True`` result only means the unicode string can be **interpreted** - as a PRN. + as a voucher. """ if not isinstance(prn, unicode): return False diff --git a/src/_secureaccesstokenauthorizer/tests/test_client_resource.py b/src/_secureaccesstokenauthorizer/tests/test_client_resource.py index 3bd4812c4fc639e510eb0227b809f002f9647645..176d6ce0a09625d06dcfa46ce1db37a9d1d92041 100644 --- a/src/_secureaccesstokenauthorizer/tests/test_client_resource.py +++ b/src/_secureaccesstokenauthorizer/tests/test_client_resource.py @@ -147,9 +147,9 @@ def not_payment_reference_numbers(): ), ), payment_reference_numbers().map( - # Turn a valid PRN into a PRN that is invalid only by containing a - # character from the base64 alphabet in place of one from the - # urlsafe-base64 alphabet. + # Turn a valid voucher into a voucher that is invalid only by + # containing a character from the base64 alphabet in place of one + # from the urlsafe-base64 alphabet. lambda prn: u"/" + prn[1:], ), ) @@ -210,7 +210,7 @@ class PaymentReferenceNumberTests(TestCase): """ Tests relating to ``/payment-reference-number`` as implemented by the ``_secureaccesstokenauthorizer.resource`` module and its handling of - payment reference numbers (PRNs). + payment reference numbers. """ def setUp(self): super(PaymentReferenceNumberTests, self).setUp() @@ -235,9 +235,9 @@ class PaymentReferenceNumberTests(TestCase): @given(tahoe_configs_with_client_config, payment_reference_numbers()) def test_put_prn(self, get_config, prn): """ - When a PRN is sent in a ``PUT`` to ``PaymentReferenceNumberCollection`` it - is passed in to the PRN redemption model object for handling and an - ``OK`` response is returned. + When a voucher is ``PUT`` to ``PaymentReferenceNumberCollection`` 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") @@ -297,8 +297,9 @@ class PaymentReferenceNumberTests(TestCase): @given(tahoe_configs_with_client_config, not_payment_reference_numbers()) def test_get_invalid_prn(self, get_config, not_prn): """ - When a syntactically invalid PRN is requested with a ``GET`` to a child of - ``PaymentReferenceNumberCollection`` the response is **BAD REQUEST**. + When a syntactically invalid voucher is requested with a ``GET`` to a + child of ``PaymentReferenceNumberCollection`` the response is **BAD + REQUEST**. """ tempdir = self.useFixture(TempDir()) config = get_config(tempdir.join(b"tahoe"), b"tub.port") @@ -325,9 +326,9 @@ class PaymentReferenceNumberTests(TestCase): @given(tahoe_configs_with_client_config, payment_reference_numbers()) def test_get_unknown_prn(self, get_config, prn): """ - When a PRN is requested with a ``GET`` to a child of + When a voucher is requested with a ``GET`` to a child of ``PaymentReferenceNumberCollection`` the response is **NOT FOUND** if - the PRN hasn't previously been submitted with a ``PUT``. + the voucher hasn't previously been submitted with a ``PUT``. """ tempdir = self.useFixture(TempDir()) config = get_config(tempdir.join(b"tahoe"), b"tub.port") @@ -348,9 +349,9 @@ class PaymentReferenceNumberTests(TestCase): @given(tahoe_configs_with_client_config, payment_reference_numbers()) def test_get_known_prn(self, get_config, prn): """ - When a PRN is first ``PUT`` and then later a ``GET`` is issued for the - same PRN then the response code is **OK** and details about the PRN - are included in a json-encoded response body. + When a voucher is first ``PUT`` and then later a ``GET`` is issued for the + same voucher then the response code is **OK** and details about the + voucher are included in a json-encoded response body. """ tempdir = self.useFixture(TempDir()) config = get_config(tempdir.join(b"tahoe"), b"tub.port") @@ -416,7 +417,7 @@ class PaymentReferenceNumberTests(TestCase): root = root_from_config(config) agent = RequestTraversalAgent(root) - note("{} PRNs".format(len(prns))) + note("{} vouchers".format(len(prns))) for prn in prns: producer = FileBodyProducer(