Permalink
Browse files

Starting to test nimbustest test client...

  • Loading branch information...
1 parent f778961 commit 44477cdf358e448335f37159679fd2b8d243f0a6 @clemesha-ooi clemesha-ooi committed Feb 11, 2010
Showing with 28 additions and 2 deletions.
  1. +3 −2 web/src/python/nimbusrest/admin/connection.py
  2. +25 −0 web/src/python/nimbusrest/tests.py
@@ -40,8 +40,9 @@ def add_user(self, user):
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):
"""
@@ -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()

0 comments on commit 44477cd

Please sign in to comment.