From 437d29cb941f7db680b4665acae24bfdcdcaf708 Mon Sep 17 00:00:00 2001 From: bnewbold Date: Wed, 25 Jul 2012 18:11:56 -0700 Subject: add timezone setting hook --- test_exmachina.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'test_exmachina.py') 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__': -- cgit v1.2.3