Esempio n. 1
0
 def test_set_data(self):
     data = Data('name')
     expected = Template(data=[data])
     template = Template()
     template.data = [data]
     self.assertIsInstance(template.data, Array)
     self.assertEqual(template, expected)
Esempio n. 2
0
 def test_set_data_invalid(self):
     template = Template()
     invalid_obj = object()
     with self.assertRaises(TypeError):
         template.data = invalid_obj