Mercurial > hgrepos > Python > libs > data-schema
comparison tests/test_schema.py @ 15:696b83f29363
Use enum props when printing validation problems
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Fri, 07 Jul 2023 02:17:45 +0200 |
| parents | 940676a0de84 |
| children | 2a9e7c4b717e |
comparison
equal
deleted
inserted
replaced
| 14:cfb97c7c9e5b | 15:696b83f29363 |
|---|---|
| 1328 check_single_ref_key=False) | 1328 check_single_ref_key=False) |
| 1329 | 1329 |
| 1330 | 1330 |
| 1331 class BasicValidation(unittest.TestCase): | 1331 class BasicValidation(unittest.TestCase): |
| 1332 | 1332 |
| 1333 def test_enum_name(self): | |
| 1334 code = ERRORS.E10001 | |
| 1335 self.assertEqual("ERRORS.E10001", str(code)) | |
| 1336 self.assertEqual("E10001", code.name) | |
| 1337 | |
| 1333 def test_schema_must_be_a_dict_alike(self): | 1338 def test_schema_must_be_a_dict_alike(self): |
| 1334 try: | 1339 try: |
| 1335 pr = list(data_schema.validate(None, None)) | 1340 pr = list(data_schema.validate(None, None)) |
| 1336 except data_schema.SchemaError: | 1341 except data_schema.SchemaError: |
| 1337 pass | 1342 pass |
