Skip to content

Commit

Permalink
Test behavior of setting x_origin
Browse files Browse the repository at this point in the history
  • Loading branch information
Petr Viktorin committed Jan 4, 2019
1 parent cd35f1c commit c186345
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Tests/t_ldap_schema_subentry.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,24 @@ def test_origin_multi_valued_str(self):
),
)

def test_set_origin_str(self):
"""Check that setting X-ORIGIN to a string makes entry unusable"""
attr = self.get_attribute_type('2.16.840.1.113719.1.301.4.24.1')
attr.x_origin = 'Netscape'
self.assertRaises(AssertionError, str, attr)

def test_set_origin_list(self):
"""Check that setting X-ORIGIN to a list makes entry unusable"""
attr = self.get_attribute_type('2.16.840.1.113719.1.301.4.24.1')
attr.x_origin = []
self.assertRaises(AssertionError, str, attr)

def test_set_origin_tuple(self):
"""Check that setting X-ORIGIN to a tuple works"""
attr = self.get_attribute_type('2.16.840.1.113719.1.301.4.24.1')
attr.x_origin = ('user defined',)
self.assertIn(" X-ORIGIN 'user defined' ", str(attr))


class TestSubschemaUrlfetchSlapd(SlapdTestCase):
ldap_object_class = SimpleLDAPObject
Expand Down

0 comments on commit c186345

Please sign in to comment.