示例#1
0
 def test_sanity_check_ok_4(self):
     d = Definition({'register': 1})
     d.set_requiered_field('name')
     self.assertEqual(d.sanity_check_ok(), False)
示例#2
0
 def test_sanity_check_ok_3(self):
     d = Definition({'register': 1, 'name': 'test'})
     d.set_requiered_field('name')
     self.assertEqual(d.sanity_check_ok(), True)
示例#3
0
 def test_sanity_check_2(self):
     d = Definition()
     d.set_requiered_field('name')
     self.assertEqual(len(d.sanity_check()), 0)
示例#4
0
 def test_sanity_check_3(self):
     d = Definition({'register': 1})
     d.set_requiered_field('name')
     self.assertEqual(len(d.sanity_check()), 1)
示例#5
0
 def test_set_requiered_field(self):
     d = Definition()
     d.set_requiered_field('name')
     self.assertEqual(d.requiered_fields, ['name'])