Пример #1
0
 def test_action(self):
     """
     Construct a ``metadata`` action..
     """
     action, _ = actions.metadata(u'http://example.com/input1')
     self.assertThat(
         action,
         Equals({u'action': u'metadata',
                 u'parameters': {
                     u'input': u'http://example.com/input1'}}))
Пример #2
0
 def test_parser(self):
     """
     Parse the output of the ``metadata`` action.
     """
     _, parser = actions.metadata(u'http://example.com/input1')
     result = {u'body': {u'page-count': 3, u'title': u'Hello World'}}
     self.assertThat(parser(result),
                     Equals({
                         u'page-count': 3,
                         u'title': u'Hello World'
                     }))
Пример #3
0
 def test_parser(self):
     """
     Parse the output of the ``metadata`` action.
     """
     _, parser = actions.metadata(u'http://example.com/input1')
     result = {u'body': {u'page-count': 3,
                         u'title': u'Hello World'}}
     self.assertThat(
         parser(result),
         Equals({u'page-count': 3,
                 u'title': u'Hello World'}))
Пример #4
0
 def test_action(self):
     """
     Construct a ``metadata`` action..
     """
     action, _ = actions.metadata(u'http://example.com/input1')
     self.assertThat(
         action,
         Equals({
             u'action': u'metadata',
             u'parameters': {
                 u'input': u'http://example.com/input1'
             }
         }))