def test_alter_delete(self): p = ObjectPipe() section = "all" res = p.alter_delete(copy(self.obj), section) self.assertEqual(res, None) section = ["hostname", "status"] res = p.alter_delete(copy(self.obj), section) self.assertFalse(hasattr(res, 'hostname')) self.assertFalse(hasattr(res, 'status'))
def test_check_match(self): p = ObjectPipe() section = { "hostname": { "conditions": [("exact", "mail.ru"), ] } } res = p.check_match(copy(self.obj), section) self.assertEqual(res, True) section = { "hostname": { "conditions": [("exact", "bail.ru"), ] } } res = p.check_match(copy(self.obj), section) self.assertEqual(res, False)