From 0d47e06d899b9c23ecc81bf95b9c1c6af9264e03 Mon Sep 17 00:00:00 2001 From: Markus Unterwaditzer Date: Sat, 12 Aug 2017 16:46:22 +0200 Subject: [PATCH] Add test re #657 --- tests/unit/test_sync.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/unit/test_sync.py b/tests/unit/test_sync.py index 4dcec3b..97538e3 100644 --- a/tests/unit/test_sync.py +++ b/tests/unit/test_sync.py @@ -660,3 +660,15 @@ def test_rollback(error_callback): else: with pytest.raises(ActionIntentionallyFailed): sync(a, b, status=status, conflict_resolution='a wins') + + +def test_duplicate_hrefs(): + a = MemoryStorage() + b = MemoryStorage() + a.list = lambda: [('a', 'a')] * 3 + a.items['a'] = ('a', Item('UID:a')) + + status = {} + sync(a, b, status) + with pytest.raises(AssertionError): + sync(a, b, status)