コード例 #1
0
ファイル: test_ldapreference.py プロジェクト: jzylks/bonsai
def test_client_prop(host_url):
    """ Testing client property. """
    client = LDAPClient(host_url)
    ref = LDAPReference(client, [])
    assert ref.client == client
    with pytest.raises(TypeError):
        ref.client = "b"

    ref.client = LDAPClient()
    assert ref.client != client
コード例 #2
0
    def test_client_prop(self):
        """ Testing client property. """
        client = LDAPClient(self.url)
        ref = LDAPReference(client, [])
        self.assertEqual(ref.client, client)

        def error():
            ref.client = "b"

        self.assertRaises(TypeError, error)
        ref.client = LDAPClient()
        self.assertNotEqual(ref.client, client)