Exemplo n.º 1
0
 def test_create_object(self):
     self.assertEqual(entities.TestObj(1, 'a'), m2m.create_object(1, 'a'))
     self.assertNotEqual(entities.TestObj(1, 'a'),
                         m2m.create_object(2, 'a'))
Exemplo n.º 2
0
 def test_catch_explode(self):
     obj = entities.TestObj(10, 'abcdef')
     self.assertTrue(m2m.catch_explode(obj))
Exemplo n.º 3
0
 def test_no_catch_explode(self):
     obj = entities.TestObj(10, 'abcdef')
     with self.assertRaises(Exception):
         m2m.no_catch_explode(obj)
Exemplo n.º 4
0
 def test_md5(self):
     obj = entities.TestObj(10, 'abcdef')
     self.assertEqual('e80b5017098950fc58aad83c8c14978e', m2m.md5(obj))
Exemplo n.º 5
0
 def test_fibinacci(self):
     obj = entities.TestObj(10, 'a')
     self.assertEqual(34, m2m.fibonacci(obj))
Exemplo n.º 6
0
 def test_list_of_clones(self):
     obj = entities.TestObj(10, 'a')
     self.assertEqual([obj, obj, obj], m2m.list_of_clones(obj, 3))
Exemplo n.º 7
0
 def test_clone(self):
     obj = entities.TestObj(10, 'a')
     self.assertEqual(obj, m2m.clone(obj))
     self.assertNotEqual(obj, m2m.clone(obj, 2))
Exemplo n.º 8
0
 def test_num_times_string(self):
     obj = entities.TestObj(10, 'a')
     self.assertEqual('a' * 10, m2m.num_times_string(obj))