def test_get_default_1(self): d = Definition({}) self.assertEqual(d.get('name'), None)
def test_init_2(self): d = Definition({'name': 'test'}) self.assertEqual(d.settings, {'name': 'test'})
def test_get(self): d = Definition({'name': 'test'}) self.assertEqual(d.get('name'), 'test')
def test___str__(self): d = Definition() self.assertNotEqual(d.__str__(), None)
def test_init_1(self): d = Definition({}) self.assertEqual(d.settings, {})
def test_set_override_false(self): d = Definition({'name': 'test'}) d.set('name', 'This is a test name', override=False) self.assertEqual(d.get('name'), 'test')
def test_has_1(self): d = Definition({'name': 'test'}) self.assertEqual(d.has('name'), True)
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)
def test_sanity_check_ok_4(self): d = Definition({'register': 1}) d.set_requiered_field('name') self.assertEqual(d.sanity_check_ok(), False)
def test_sanity_check_2(self): d = Definition() d.set_requiered_field('name') self.assertEqual(len(d.sanity_check()), 0)
def test_sanity_check_3(self): d = Definition({'register': 1}) d.set_requiered_field('name') self.assertEqual(len(d.sanity_check()), 1)
def test_set_requiered_field(self): d = Definition() d.set_requiered_field('name') self.assertEqual(d.requiered_fields, ['name'])
def test_register(self): d = Definition({'name': 'test'}) d.register() self.assertEqual(DM.filter(name='test').pop(), d)
def test_has_2(self): d = Definition({}) self.assertEqual(d.has('name'), False)
def test_set_default_3(self): d = Definition({}) d.set_default('name', 'test') self.assertEqual(d.get('name'), 'test')
def test_load_defaults_2(self): d = Definition({'name': 'test'}) d.set_default('name', 'This is a test') d.load_defaults() self.assertEqual(d.settings, {'name': 'test'})
def test_set(self): d = Definition({'name': 'This is a test name'}) d.set('name', 'test') self.assertEqual(d.get('name'), 'test')
def test_inheritance(self): d = Definition() self.assertEqual(d.load_inheritance(), None)
def test_load_settings_2(self): d = Definition({'name': 'test'}) d.load_settings({'name': 'This is a test name'}) self.assertEqual(d.settings, {'name': 'test'})
def test_load_settings_3(self): d = Definition({'name': 'test'}) d.load_settings({'name': 'This is a test name'}, override=True) self.assertEqual(d.settings, {'name': 'This is a test name'})