aboutsummaryrefslogtreecommitdiffstats
path: root/test_exmachina.py
diff options
context:
space:
mode:
Diffstat (limited to 'test_exmachina.py')
-rwxr-xr-xtest_exmachina.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/test_exmachina.py b/test_exmachina.py
index ec73def..e8d239d 100755
--- a/test_exmachina.py
+++ b/test_exmachina.py
@@ -20,13 +20,11 @@ at the same time:
"""
import sys
-import optparse
-import logging
import socket
import bjsonrpc
import bjsonrpc.connection
-import augeas
+from bjsonrpc.exceptions import ServerError
from exmachina import ExMachinaClient
@@ -62,12 +60,22 @@ def main():
client = ExMachinaClient(secret_key=secret_key)
print client.augeas.match("/files/etc/*")
#print client.initd.restart("bluetooth")
- print client.initd.status("greentooth")
+ try:
+ print client.initd.status("greentooth")
+ print "ERROR: should have failed above!"
+ except ServerError:
+ print "(got expected error, good!)"
print "(expect Error on the above line)"
print client.initd.status("bluetooth")
print client.apt.install("pkg_which_does_not_exist")
print client.apt.remove("pkg_which_does_not_exist")
#print client.apt.update() # can be slow...
+ #print client.misc.set_timezone("UTC") # don't clobber system...
+ try:
+ print client.misc.set_timezone("whoopie") # should be an error
+ print "ERROR: should have failed above!"
+ except ServerError:
+ print "(got expected error, good!)"
client.close()
if __name__ == '__main__':