Make validation run by default when initializing an AuDaGeFrame.

This commit is contained in:
Silcantar
2026-10-02 16:32:56 -05:00
parent 8e658e02d5
commit 721f3d4c21
2 changed files with 33 additions and 20 deletions

View File

@@ -5,24 +5,20 @@ from AuDaGe.audage_frame import AuDaGeFrame
class TestAuDaGeFrame(unittest.TestCase):
def test_init(self):
valid_adf = AuDaGeFrame(
{
"name": ["a", "b", "c"],
"type": ["d", "e", "f"],
"address": [1, 2, 3],
"comment": ["g", "h", "i"],
}
)
self.assertTrue(valid_adf.is_valid())
invalid_adf = AuDaGeFrame(
{
"name": ["a", "b", "c"],
# "type": ["d", "e", "f"],
"address": [1, 2, 3],
"comment": ["g", "h", "i"],
}
)
self.assertFalse(invalid_adf.is_valid())
valid_adf = {
"name": ["a", "b", "c"],
"type": ["d", "e", "f"],
"address": [1, 2, 3],
"comment": ["g", "h", "i"],
}
self.assertTrue(AuDaGeFrame(valid_adf).is_valid())
invalid_adf = {
"name": ["a", "b", "c"],
# "type": ["d", "e", "f"],
"address": [1, 2, 3],
"comment": ["g", "h", "i"],
}
self.assertRaises(ValueError, AuDaGeFrame, invalid_adf)
if __name__ == "__main__":