예제 #1
0
 def test_to_dict_minimal(self):
     query = Query('href', 'rel')
     expected = {
         'href': 'href',
         'rel': 'rel',
     }
     self.assertEqual(query.to_dict(), expected)
예제 #2
0
 def test_to_dict_with_data(self):
     data = [Data('name')]
     query = Query('href', 'rel', 'name', 'prompt', data)
     expected = {
         'href': 'href',
         'rel': 'rel',
         'name': 'name',
         'prompt': 'prompt',
         'data': [
             {'name': 'name'}
         ]
     }
     self.assertEqual(query.to_dict(), expected)