Skip to content
This repository has been archived by the owner on Sep 23, 2020. It is now read-only.

Commit

Permalink
Starting to test nimbustest test client...
Browse files Browse the repository at this point in the history
  • Loading branch information
clemesha-ooi committed Feb 11, 2010
1 parent f778961 commit 44477cd
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
5 changes: 3 additions & 2 deletions web/src/python/nimbusrest/admin/connection.py
Expand Up @@ -40,8 +40,9 @@ def add_user(self, user):


udict = {'dn' : user.dn} udict = {'dn' : user.dn}


u = self.post_json('users/', udict) resp = self.post_json('users/', udict)
return self._user_from_data(u) print 'resp is None --> ', resp, udict
return self._user_from_data(resp)


def get_user(self, user_id): def get_user(self, user_id):
""" """
Expand Down
25 changes: 25 additions & 0 deletions 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()

0 comments on commit 44477cd

Please sign in to comment.