Exemple #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']))
Exemple #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]]}}))
Exemple #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]]
             }
         }))
Exemple #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']))