Beispiel #1
0
def test_set_bind_properties():
    """ Test setting LDAPURL bind properties. """
    url = LDAPURL()
    with pytest.raises(InvalidDN):
        url.basedn = "test"

    url.basedn = LDAPDN("cn=test")
    assert str(url.basedn) == "cn=test"
Beispiel #2
0
def test_set_bind_properties():
    """ Test setting LDAPURL bind properties. """
    url = LDAPURL()
    with pytest.raises(InvalidDN):
        url.basedn = "test"

    url.basedn = LDAPDN("cn=test")
    assert str(url.basedn) == "cn=test"
Beispiel #3
0
    def test_set_bind_properties(self):
        """ Test setting LDAPURL bind properties. """
        url = LDAPURL()

        def invalid_basedn():
            url.basedn = "test"

        self.assertRaises(InvalidDN, invalid_basedn)
        url.basedn = LDAPDN("cn=test")
        self.assertEqual(str(url.basedn), "cn=test")