linked attribute tests: fix logic for add test
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Tue, 24 Oct 2017 23:17:05 +0000 (12:17 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 25 Oct 2017 23:32:14 +0000 (01:32 +0200)
We were ensuring that when we got an LdbError it was the right type,
but we weren't ensuring we got one at all.

The new test doesn't fail.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/dsdb/tests/python/linked_attributes.py

index f0c260564bf2d604380d70eda3561bfa3913ed2e..1923f68774962b238ad569a748e500d33c617fb1 100644 (file)
@@ -401,6 +401,8 @@ class LATests(samba.tests.TestCase):
                 self.fail("adding duplicate values, expected "
                           "ERR_ENTRY_ALREADY_EXISTS, (%d) "
                           "got %d" % (ldb.ERR_ENTRY_ALREADY_EXISTS, num))
+        else:
+            self.fail("adding duplicate values succeed when it shouldn't")
 
         self.assert_forward_links(g1, [u1, u2, u3, u4])
         self.assert_forward_links(g2, [u3, u1])