diff options
author | bnewbold <bnewbold@robocracy.org> | 2012-07-25 18:11:56 -0700 |
---|---|---|
committer | bnewbold <bnewbold@robocracy.org> | 2012-07-25 18:12:19 -0700 |
commit | 437d29cb941f7db680b4665acae24bfdcdcaf708 (patch) | |
tree | 199ba5a81b2a8fb8c6b6918cb24f9b8edace9253 /test_exmachina.py | |
parent | 3dbedae6d25dc4652f7ac1a1542e19e630b90894 (diff) | |
download | exmachina-437d29cb941f7db680b4665acae24bfdcdcaf708.tar.gz exmachina-437d29cb941f7db680b4665acae24bfdcdcaf708.zip |
add timezone setting hook
Diffstat (limited to 'test_exmachina.py')
-rwxr-xr-x | test_exmachina.py | 16 |
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__': |