@@ -86,6 +86,62 @@ def test_origin_multi_valued(self):
86
86
self .get_attribute_type ('1.3.6.1.4.1.11.1.3.1.1.3' ).x_origin ,
87
87
('RFC4876' , 'user defined' ))
88
88
89
+ def test_origin_none_str (self ):
90
+ """Check string representation of an attribute without X-ORIGIN"""
91
+ # This should check that the representation:
92
+ # - does not contain X-ORIGIN, and
93
+ # - is still syntactically valid.
94
+ # Checking the full output makes the test simpler,
95
+ # though might need to be adjusted in the future.
96
+ self .assertEqual (
97
+ str (self .get_attribute_type ('2.16.840.1.113719.1.301.4.24.1' )),
98
+ (
99
+ "( 2.16.840.1.113719.1.301.4.24.1 "
100
+ + "NAME 'krbHostServer' "
101
+ + "EQUALITY caseExactIA5Match "
102
+ + "SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )"
103
+ ),
104
+ )
105
+
106
+ def test_origin_string_str (self ):
107
+ """Check string representation of an attr with single-value X-ORIGIN"""
108
+ # This should check that the representation:
109
+ # - has the X-ORIGIN entry 'Netscape' with no parentheses, and
110
+ # - is still syntactically valid.
111
+ # Checking the full output makes the test simpler,
112
+ # though might need to be adjusted in the future.
113
+ self .assertEqual (
114
+ str (self .get_attribute_type ('2.16.840.1.113730.3.1.2091' )),
115
+ (
116
+ "( 2.16.840.1.113730.3.1.2091 "
117
+ + "NAME 'nsslapd-suffix' "
118
+ + "DESC 'Netscape defined attribute type' "
119
+ + "SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 "
120
+ + "X-ORIGIN 'Netscape' )"
121
+ ),
122
+ )
123
+
124
+ def test_origin_multi_valued_str (self ):
125
+ """Check string representation of an attr with multi-value X-ORIGIN"""
126
+ # This should check that the representation:
127
+ # - has a parenthesized X-ORIGIN entry, and
128
+ # - is still syntactically valid.
129
+ # Checking the full output makes the test simpler,
130
+ # though might need to be adjusted in the future.
131
+ self .assertEqual (
132
+ str (self .get_attribute_type ('1.3.6.1.4.1.11.1.3.1.1.3' )),
133
+ (
134
+ "( 1.3.6.1.4.1.11.1.3.1.1.3 NAME 'searchTimeLimit' "
135
+ + "DESC 'Maximum time an agent or service allows for a search "
136
+ + "to complete' "
137
+ + "EQUALITY integerMatch "
138
+ + "ORDERING integerOrderingMatch "
139
+ + "SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 "
140
+ + "SINGLE-VALUE "
141
+ + "X-ORIGIN ( 'RFC4876' 'user defined' ) )"
142
+ ),
143
+ )
144
+
89
145
90
146
class TestSubschemaUrlfetchSlapd (SlapdTestCase ):
91
147
ldap_object_class = SimpleLDAPObject
0 commit comments