예제 #1
0
 def test_item_substring_any(self):
     text = r'*foo*'
     filt = pureldap.LDAPFilter_substrings(
         type='cn',
         substrings=[pureldap.LDAPFilter_substrings_any('foo'),
                     ])
     self.assertEquals(ldapfilter.parseMaybeSubstring('cn', text), filt)
예제 #2
0
 def test_item_substring_if(self):
     text = r'foo*bar'
     filt = pureldap.LDAPFilter_substrings(
         type='cn',
         substrings=[pureldap.LDAPFilter_substrings_initial('foo'),
                     pureldap.LDAPFilter_substrings_final('bar'),
                     ])
     self.assertEquals(ldapfilter.parseMaybeSubstring('cn', text), filt)
예제 #3
0
 def test_escape_simple(self):
     text = r'f\2aoo(bar'
     filt = pureldap.LDAPFilter_equalityMatch(
         attributeDesc=pureldap.LDAPAttributeDescription(value='cn'),
         assertionValue=pureldap.LDAPAssertionValue(value='f*oo(bar'))
     self.assertEquals(ldapfilter.parseMaybeSubstring('cn', text), filt)
예제 #4
0
 def test_item_present(self):
     text = r'*'
     filt = pureldap.LDAPFilter_present(value='cn')
     self.assertEquals(ldapfilter.parseMaybeSubstring('cn', text), filt)