pointless refactoring of stuff that's never used
This commit is contained in:
parent
c7e1902aa2
commit
3b8181062c
|
@ -275,6 +275,7 @@ class AirtimeApiClient(object):
|
||||||
|
|
||||||
|
|
||||||
def get_schedule(self):
|
def get_schedule(self):
|
||||||
|
# TODO : properly refactor this routine
|
||||||
logger = self.logger
|
logger = self.logger
|
||||||
|
|
||||||
# Construct the URL
|
# Construct the URL
|
||||||
|
|
|
@ -21,27 +21,26 @@ import inspect
|
||||||
from configobj import ConfigObj
|
from configobj import ConfigObj
|
||||||
|
|
||||||
# custom imports
|
# custom imports
|
||||||
from util import *
|
#from util import *
|
||||||
from api_clients import *
|
from api_client import AirtimeApiClient
|
||||||
|
|
||||||
import random
|
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
# configure logging
|
# configure logging
|
||||||
logging.config.fileConfig("logging-api-validator.cfg")
|
#logging.config.fileConfig("logging-api-validator.cfg")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
config = ConfigObj('/etc/airtime/pypo.cfg')
|
config = ConfigObj('/etc/airtime/pypo.cfg')
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
print 'Error loading config file: ', e
|
print 'Error loading config file: ', e
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
|
|
||||||
class TestApiFunctions(unittest.TestCase):
|
class TestApiFunctions(unittest.TestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.api_client = api_client.api_client_factory(config)
|
self.api_client = AirtimeApiClient()
|
||||||
|
|
||||||
def test_is_server_compatible(self):
|
def test_is_server_compatible(self):
|
||||||
self.assertTrue(self.api_client.is_server_compatible(False))
|
self.assertTrue(self.api_client.is_server_compatible(False))
|
||||||
|
|
||||||
|
@ -59,16 +58,17 @@ class TestApiFunctions(unittest.TestCase):
|
||||||
arr = dict()
|
arr = dict()
|
||||||
arr["x"] = dict()
|
arr["x"] = dict()
|
||||||
arr["x"]["schedule_id"]=1
|
arr["x"]["schedule_id"]=1
|
||||||
|
|
||||||
response = self.api_client.notify_scheduled_item_start_playing("x", arr)
|
response = self.api_client.notify_scheduled_item_start_playing("x", arr)
|
||||||
self.assertTrue(response.has_key("status"))
|
self.assertTrue(response.has_key("status"))
|
||||||
self.assertTrue(response.has_key("message"))
|
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)
|
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("status"))
|
||||||
self.assertTrue(response.has_key("message"))
|
self.assertTrue(response.has_key("message"))
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|
Loading…
Reference in New Issue