Warn if an import contains multiple occurrences of the same UUID (#3560)

This commit is contained in:
Adrian Sadłocha 2024-07-20 03:27:16 +01:00 committed by GitHub
parent 0650fe509f
commit 7ea4baed77
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 28 additions and 1 deletions

View file

@ -224,6 +224,15 @@ class TestImport(TestCase):
code, out2, err = self.t("export")
self.assertEqual(out1, out2)
def test_import_duplicate_uuid_in_input(self):
"""Test import warns if input contains the same UUID twice."""
_data = """[
{"uuid":"a0000000-a000-a000-a000-a00000000000","description":"first description"},
{"uuid":"a0000000-a000-a000-a000-a00000000000","description":"second description"}
]"""
_, _, err = self.t("import", input=_data)
self.assertIn("Input contains UUID 'a0000000-a000-a000-a000-a00000000000' 2 times", err)
class TestImportExportRoundtrip(TestCase):
def setUp(self):