File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -142,6 +142,24 @@ def test_origin_multi_valued_str(self):
142142 ),
143143 )
144144
145+ def test_set_origin_str (self ):
146+ """Check that setting X-ORIGIN to a string makes entry unusable"""
147+ attr = self .get_attribute_type ('2.16.840.1.113719.1.301.4.24.1' )
148+ attr .x_origin = 'Netscape'
149+ self .assertRaises (AssertionError , str , attr )
150+
151+ def test_set_origin_list (self ):
152+ """Check that setting X-ORIGIN to a list makes entry unusable"""
153+ attr = self .get_attribute_type ('2.16.840.1.113719.1.301.4.24.1' )
154+ attr .x_origin = []
155+ self .assertRaises (AssertionError , str , attr )
156+
157+ def test_set_origin_tuple (self ):
158+ """Check that setting X-ORIGIN to a tuple works"""
159+ attr = self .get_attribute_type ('2.16.840.1.113719.1.301.4.24.1' )
160+ attr .x_origin = ('user defined' ,)
161+ self .assertIn (" X-ORIGIN 'user defined' " , str (attr ))
162+
145163
146164class TestSubschemaUrlfetchSlapd (SlapdTestCase ):
147165 ldap_object_class = SimpleLDAPObject
You can’t perform that action at this time.
0 commit comments