Created
February 11, 2010 21:18
-
-
Save clemesha-ooi/301964 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ommit 44477cdf358e448335f37159679fd2b8d243f0a6 | |
Author: Alex Clemesha <[email protected]> | |
Date: Thu Feb 11 13:12:28 2010 -0800 | |
Starting to test nimbustest test client... | |
diff --git a/web/src/python/nimbusrest/admin/connection.py b/web/src/python/nimbusrest/admin/connection.py | |
index c1ebdf7..c2b5dfa 100644 | |
--- a/web/src/python/nimbusrest/admin/connection.py | |
+++ b/web/src/python/nimbusrest/admin/connection.py | |
@@ -40,8 +40,9 @@ class AdminConnection(Connection): | |
udict = {'dn' : user.dn} | |
- u = self.post_json('users/', udict) | |
- return self._user_from_data(u) | |
+ resp = self.post_json('users/', udict) | |
+ print 'resp is None --> ', resp, udict | |
+ return self._user_from_data(resp) | |
def get_user(self, user_id): | |
""" | |
diff --git a/web/src/python/nimbusrest/tests.py b/web/src/python/nimbusrest/tests.py | |
new file mode 100644 | |
index 0000000..ddd44ba | |
--- /dev/null | |
+++ b/web/src/python/nimbusrest/tests.py | |
@@ -0,0 +1,25 @@ | |
+import unittest | |
+from nimbusrest.admin.connection import AdminConnection | |
+ | |
+ | |
+class FakeUser(object): | |
+ id = 1 | |
+ dn = "test_dn" | |
+ | |
+class TestNimbusRestClient(unittest.TestCase): | |
+ | |
+ def setUp(self): | |
+ self.user = FakeUser() | |
+ self.uri = "http://localhost:4443/admin/" | |
+ self.key = "testadmin" | |
+ self.secret = "secret" | |
+ self.conn = AdminConnection(self.uri, self.key, self.secret) | |
+ | |
+ def test_add_user(self): | |
+ resp = self.conn.add_user(self.user) | |
+ print resp | |
+ self.assertEquals(1, 1) | |
+ | |
+ | |
+if __name__ == '__main__': | |
+ unittest.main() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment