diff options
author | Rob Crittenden <rcritten@redhat.com> | 2009-01-28 21:47:21 -0700 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2009-02-03 15:29:04 -0500 |
commit | 5717c9d6689f15c46801f2d251e174fad4ce4748 (patch) | |
tree | 31e2a3378638bd63005a3d65d7fe74159860456c /tests/test_xmlrpc/test_service_plugin.py | |
parent | 48a278047db50f919a45ef82a57a6983804ed523 (diff) | |
download | freeipa-5717c9d6689f15c46801f2d251e174fad4ce4748.tar.gz freeipa-5717c9d6689f15c46801f2d251e174fad4ce4748.tar.xz freeipa-5717c9d6689f15c46801f2d251e174fad4ce4748.zip |
Applied Rob's errors patch
Diffstat (limited to 'tests/test_xmlrpc/test_service_plugin.py')
-rw-r--r-- | tests/test_xmlrpc/test_service_plugin.py | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/tests/test_xmlrpc/test_service_plugin.py b/tests/test_xmlrpc/test_service_plugin.py index ca5d7e01e..1390d34ea 100644 --- a/tests/test_xmlrpc/test_service_plugin.py +++ b/tests/test_xmlrpc/test_service_plugin.py @@ -45,12 +45,37 @@ class test_Service(XMLRPC_test): def test_add_host(self): """ - Test adding a host principal using `xmlrpc.service_add` method. + Test adding a host principal using `xmlrpc.service_add`. Host + services are not allowed. """ kw={'principal':self.hostprincipal} try: res = api.Command['service_add'](**kw) - except errors.HostService: + except errors2.HostService: + pass + else: + assert False + + def test_add_malformed1(self): + """ + Test adding a malformed principal ('foo'). + """ + kw={'principal':'foo'} + try: + res = api.Command['service_add'](**kw) + except errors2.MalformedServicePrincipal: + pass + else: + assert False + + def test_add_wrongrealm(self): + """ + Test adding a malformed principal ('HTTP/foo@FOO.NET'). + """ + kw={'principal':'HTTP/foo@FOO.NET'} + try: + res = api.Command['service_add'](**kw) + except errors2.RealmMismatch: pass else: assert False @@ -82,7 +107,7 @@ class test_Service(XMLRPC_test): # Verify that it is gone try: res = api.Command['service_show'](self.principal) - except errors.NotFound: + except errors2.NotFound: pass else: assert False |