Пример #1
0
 def test_set_data(self):
     data = Data('name')
     expected = Query('href', 'rel', data=[data])
     query = Query('href', 'rel')
     query.data = [data]
     self.assertIsInstance(query.data, Array)
     self.assertEqual(query, expected)
Пример #2
0
 def test_set_data_invalid(self):
     query = Query('href', 'rel')
     invalid_obj = object()
     with self.assertRaises(TypeError):
         query.data = invalid_obj