Exemplo n.º 1
0
 def test_parser(self):
     """
     Parse the output of the ``split`` action.
     """
     _, parser = actions.split(u'http://example.com/input1',
                               [[1, 2], [2, 3]])
     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 ``split`` action..
     """
     action, _ = actions.split(u'http://example.com/input1',
                               [[1, 2], [2, 3]])
     self.assertThat(
         action,
         Equals({u'action': u'split',
                 u'parameters': {
                     u'input': u'http://example.com/input1',
                     u'page-groups': [[1, 2], [2, 3]]}}))
Exemplo n.º 3
0
 def test_action(self):
     """
     Construct a ``split`` action..
     """
     action, _ = actions.split(u'http://example.com/input1',
                               [[1, 2], [2, 3]])
     self.assertThat(
         action,
         Equals({
             u'action': u'split',
             u'parameters': {
                 u'input': u'http://example.com/input1',
                 u'page-groups': [[1, 2], [2, 3]]
             }
         }))
Exemplo n.º 4
0
 def test_parser(self):
     """
     Parse the output of the ``split`` action.
     """
     _, parser = actions.split(u'http://example.com/input1',
                               [[1, 2], [2, 3]])
     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']))