From 3b8181062c261fa5b694e22f584e0c68336c9a79 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Tue, 30 Oct 2012 17:35:10 -0400 Subject: [PATCH] pointless refactoring of stuff that's never used --- python_apps/api_clients/api_client.py | 1 + python_apps/pypo/test/pypo-api-validator.py | 24 ++++++++++----------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/python_apps/api_clients/api_client.py b/python_apps/api_clients/api_client.py index be3776980..66524e762 100644 --- a/python_apps/api_clients/api_client.py +++ b/python_apps/api_clients/api_client.py @@ -275,6 +275,7 @@ class AirtimeApiClient(object): def get_schedule(self): + # TODO : properly refactor this routine logger = self.logger # Construct the URL diff --git a/python_apps/pypo/test/pypo-api-validator.py b/python_apps/pypo/test/pypo-api-validator.py index 0fcce4fef..091c2340c 100644 --- a/python_apps/pypo/test/pypo-api-validator.py +++ b/python_apps/pypo/test/pypo-api-validator.py @@ -21,27 +21,26 @@ import inspect from configobj import ConfigObj # custom imports -from util import * -from api_clients import * +#from util import * +from api_client import AirtimeApiClient -import random import unittest # configure logging -logging.config.fileConfig("logging-api-validator.cfg") +#logging.config.fileConfig("logging-api-validator.cfg") try: config = ConfigObj('/etc/airtime/pypo.cfg') except Exception, e: print 'Error loading config file: ', e sys.exit() - - + + class TestApiFunctions(unittest.TestCase): def setUp(self): - self.api_client = api_client.api_client_factory(config) - + self.api_client = AirtimeApiClient() + def test_is_server_compatible(self): self.assertTrue(self.api_client.is_server_compatible(False)) @@ -59,16 +58,17 @@ class TestApiFunctions(unittest.TestCase): arr = dict() arr["x"] = dict() arr["x"]["schedule_id"]=1 - + response = self.api_client.notify_scheduled_item_start_playing("x", arr) self.assertTrue(response.has_key("status")) self.assertTrue(response.has_key("message")) - def test_notify_media_item_start_playing(self): + def test_notify_media_item_start_playing(self): response = self.api_client.notify_media_item_start_playing('{"schedule_id":1}', 5) + return response = self.assertTrue(response.has_key("status")) self.assertTrue(response.has_key("message")) - - + + if __name__ == '__main__': unittest.main()