Exemplo n.º 1
0
 def test_parser(self):
     """
     Parse the output of the ``sign`` action.
     """
     _, parser = actions.sign([u'http://example.com/input1',
                               u'http://example.com/input2'],
                              u'c', u'l', u'r')
     result = {u'links': {u'results': [u'http://example.com/output1',
                                       u'http://example.com/output2']}}
     self.assertThat(
         parser(result),
         Equals([u'http://example.com/output1',
                 u'http://example.com/output2']))
Exemplo n.º 2
0
 def test_action(self):
     """
     Construct a ``sign`` action..
     """
     action, _ = actions.sign([u'http://example.com/input1',
                               u'http://example.com/input2'],
                              u'c', u'l', u'r')
     self.assertThat(
         action,
         Equals({u'action': u'sign',
                 u'parameters': {
                     u'inputs': [u'http://example.com/input1',
                                 u'http://example.com/input2'],
                     u'certificate-alias': u'c',
                     u'location': u'l',
                     u'reason': u'r'}}))
Exemplo n.º 3
0
 def test_parser(self):
     """
     Parse the output of the ``sign`` action.
     """
     _, parser = actions.sign(
         [u'http://example.com/input1', u'http://example.com/input2'], u'c',
         u'l', u'r')
     result = {
         u'links': {
             u'results':
             [u'http://example.com/output1', u'http://example.com/output2']
         }
     }
     self.assertThat(
         parser(result),
         Equals(
             [u'http://example.com/output1',
              u'http://example.com/output2']))
Exemplo n.º 4
0
 def test_action(self):
     """
     Construct a ``sign`` action..
     """
     action, _ = actions.sign(
         [u'http://example.com/input1', u'http://example.com/input2'], u'c',
         u'l', u'r')
     self.assertThat(
         action,
         Equals({
             u'action': u'sign',
             u'parameters': {
                 u'inputs': [
                     u'http://example.com/input1',
                     u'http://example.com/input2'
                 ],
                 u'certificate-alias':
                 u'c',
                 u'location':
                 u'l',
                 u'reason':
                 u'r'
             }
         }))