コード例 #1
0
ファイル: handlers.py プロジェクト: zeus911/certifire
 def get_orderResource(self, order_id):
     order_db = Order.query.get(order_id)
     order = acmeOrder.from_json(json.loads(order_db.contents)['body'])
     orderr = OrderResource.from_json(json.loads(order_db.contents))
     authorizations = []
     for url in order.authorizations:
         authorizations.append(
             self.client._authzr_from_response(
                 self.client._post_as_get(url), uri=url))
     return orderr.update(authorizations=authorizations)
コード例 #2
0
class OrderResourceTest(unittest.TestCase):
    """Tests for acme.messages.OrderResource."""

    def setUp(self):
        from acme.messages import OrderResource
        self.regr = OrderResource(
            body=mock.sentinel.body, uri=mock.sentinel.uri)

    def test_to_partial_json(self):
        self.assertEqual(self.regr.to_json(), {
            'body': mock.sentinel.body,
            'uri': mock.sentinel.uri,
            'authorizations': None,
        })
コード例 #3
0
class OrderResourceTest(unittest.TestCase):
    """Tests for acme.messages.OrderResource."""

    def setUp(self):
        from acme.messages import OrderResource
        self.regr = OrderResource(
            body=mock.sentinel.body, uri=mock.sentinel.uri)

    def test_to_partial_json(self):
        self.assertEqual(self.regr.to_json(), {
            'body': mock.sentinel.body,
            'uri': mock.sentinel.uri,
            'authorizations': None,
        })
コード例 #4
0
 def setUp(self):
     from acme.messages import OrderResource
     self.regr = OrderResource(
         body=mock.sentinel.body, uri=mock.sentinel.uri)
コード例 #5
0
 def setUp(self):
     from acme.messages import OrderResource
     self.regr = OrderResource(
         body=mock.sentinel.body, uri=mock.sentinel.uri)