Esempio n. 1
0
 def test_extensibleMatch4_noMatch(self):
     """
     An extensibleMatch filter that uses DN attributes does not match an entry
     based on its OU.
     See RFC4511 section 4.5.1.
     """
     m = pureldap.LDAPFilter_extensibleMatch(
         matchingRule=None,
         type=pureldap.LDAPMatchingRuleAssertion_type(value='ou'),
         matchValue=pureldap.LDAPMatchingRuleAssertion_matchValue(
             value='fings'),
         dnAttributes=pureldap.LDAPMatchingRuleAssertion_dnAttributes(
             value=255))
     o = inmemory.ReadOnlyInMemoryLDAPEntry(
         dn='cn=foo,ou=uvvers,dc=example,dc=com',
         attributes={
             'objectClass': ['a', 'b'],
             'aValue': ['b'],
             'num': [4],
         })
     result = o.match(m)
     self.assertEqual(result, False)
Esempio n. 2
0
 def test_extensibleMatch4_noMatch(self):
     """
     An extensibleMatch filter that uses DN attributes does not match an entry
     based on its OU.
     See RFC4511 section 4.5.1.
     """
     m = pureldap.LDAPFilter_extensibleMatch(
         matchingRule=None,
         type=pureldap.LDAPMatchingRuleAssertion_type(value="ou"),
         matchValue=pureldap.LDAPMatchingRuleAssertion_matchValue(
             value="fings"),
         dnAttributes=pureldap.LDAPMatchingRuleAssertion_dnAttributes(
             value=255),
     )
     o = inmemory.ReadOnlyInMemoryLDAPEntry(
         dn="cn=foo,ou=uvvers,dc=example,dc=com",
         attributes={
             "objectClass": ["a", "b"],
             "aValue": ["b"],
             "num": [4],
         },
     )
     result = o.match(m)
     self.assertEqual(result, False)