def make_test_aci(): a = ACI() a.name ="foo" a.set_target_attr(['title','givenname'], "!=") a.set_bindrule_keyword("groupdn") a.set_bindrule_operator("=") a.set_bindrule_expression("\"ldap:///cn=foo,cn=groups,cn=accounts,dc=example,dc=com\"") a.permissions = ['read','write','add'] return a
def make_test_aci(): a = ACI() a.name = "foo" a.set_target_attr(['title', 'givenname'], "!=") a.set_bindrule_keyword("groupdn") a.set_bindrule_operator("=") a.set_bindrule_expression( "\"ldap:///cn=foo,cn=groups,cn=accounts,dc=example,dc=com\"") a.permissions = ['read', 'write', 'add'] return a
def test_aci_equality(): a = make_test_aci() print(a) b = ACI() b.name ="foo" b.set_target_attr(['givenname','title'], "!=") b.set_bindrule_keyword("groupdn") b.set_bindrule_operator("=") b.set_bindrule_expression("\"ldap:///cn=foo,cn=groups,cn=accounts,dc=example,dc=com\"") b.permissions = ['add','read','write'] print(b) assert a.isequal(b) assert a == b assert not a != b
def test_aci_equality(): a = make_test_aci() print(a) b = ACI() b.name = "foo" b.set_target_attr(['givenname', 'title'], "!=") b.set_bindrule_keyword("groupdn") b.set_bindrule_operator("=") b.set_bindrule_expression( "\"ldap:///cn=foo,cn=groups,cn=accounts,dc=example,dc=com\"") b.permissions = ['add', 'read', 'write'] print(b) assert a.isequal(b) assert a == b assert not a != b # pylint: disable=unneeded-not