diff options
author | Pavel Zuna <pzuna@redhat.com> | 2009-06-24 15:10:05 +0200 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2009-07-02 13:33:04 -0400 |
commit | 57b55d8e2fb452607243cc504204df490661df65 (patch) | |
tree | 670ba505cbee4bbf534870616d8d126348049527 /tests | |
parent | 12ee586392c774f4647ab9a3d744a98359c9cf7e (diff) | |
download | freeipa-57b55d8e2fb452607243cc504204df490661df65.tar.gz freeipa-57b55d8e2fb452607243cc504204df490661df65.tar.xz freeipa-57b55d8e2fb452607243cc504204df490661df65.zip |
Add utility functions for plugin unit testing.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_xmlrpc/xmlrpc_test.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test_xmlrpc/xmlrpc_test.py b/tests/test_xmlrpc/xmlrpc_test.py index 42309add1..9c41d053f 100644 --- a/tests/test_xmlrpc/xmlrpc_test.py +++ b/tests/test_xmlrpc/xmlrpc_test.py @@ -27,6 +27,17 @@ import nose from ipalib import api, request from ipalib import errors + +def assert_attr_equal(entry_attrs, attr, value): + assert value in entry_attrs.get(attr, []) + +def assert_is_member(entry_attrs, value, member_attr='member'): + for m in entry_attrs[member_attr]: + if m.startswith(value): + return + assert False + + # Initialize the API. We do this here so that one can run the tests # individually instead of at the top-level. If API.bootstrap() # has already been called we continue gracefully. Other errors will be @@ -52,3 +63,4 @@ class XMLRPC_test(object): nose tear-down fixture. """ request.destroy_context() + |