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