'{"id":3,"schedule_id":3,"automation-id":1,"className":"TestData","memo":"TestData","show_fundingcategory":"TestData","start":"'+(datetime.now()+timedelta(hours=2)).strftime('%Y-%m-%dT%H:00:00')+'","end":"'+(datetime.now()+timedelta(hours=3)).strftime('%Y-%m-%dT%H:00:00')+'","show_id":11,"show_name":"TestData: Radio für Senioren","show_hosts":"TestData: Sandra Hochholzer, Martina Schweiger","title":"TestData:title","is_repetition":false,"playlist_id":6,"schedule_fallback_id":32,"show_fallback_id":112,"station_fallback_id":1,"rtr_category":"TestData: string","comment":"TestData: Kommentar","show_languages":"TestData: Sprachen","show_type":"TestData: Typ","show_categories":"TestData: Kategorie","show_topics":"TestData: Topic","show_musicfocus":"TestData: Fokus"}]'
'{"id":3,"schedule_id":3,"automation-id":1,"className":"TestData","memo":"TestData","show_fundingcategory":"TestData","start":"'+(datetime.now()+timedelta(hours=2)).strftime('%Y-%m-%dT%H:00:00')+'","end":"'+(datetime.now()+timedelta(hours=3)).strftime('%Y-%m-%dT%H:00:00')+'","show_id":11,"show_name":"TestData: Radio für Senioren","show_hosts":"TestData: Sandra Hochholzer, Martina Schweiger","title":"TestData:title","is_repetition":false,"playlist_id":6,"schedule_fallback_id":32,"show_fallback_id":112,"station_fallback_id":1,"rtr_category":"TestData: string","comment":"TestData: Kommentar","show_languages":"TestData: Sprachen","show_type":"TestData: Typ","show_categories":"TestData: Kategorie","show_topics":"TestData: Topic","show_musicfocus":"TestData: Fokus"}]'
self.logger.critical("Hardcoded Response")
self.logger.critical("Using hardcoded Response!")
else:
else:
html_response="{}"
html_response="{}"
# convert to dict
# convert to dict
schedule=simplejson.loads(html_response)
schedule=simplejson.loads(html_response)
# check data
# check data
self.logger.critical("no JSON data checks. I believe what i get here")
self.logger.critical("no JSON data checks. I believe what i get here")
# FIXME move hardcoded test-data to separate testing logic.
# HARDCODED Testdata
# HARDCODED Testdata
ifid_name!="playlist_id":
ifid_name!="playlist_id":
# FALLBACK TESTDATA
# FALLBACK TESTDATA
...
@@ -275,4 +342,4 @@ class CalendarFetcher:
...
@@ -275,4 +342,4 @@ class CalendarFetcher:
self.logger.info("Using 'randomized' playlist: "+json_response+" for "+id_name[:-3]+" for show "+schedule["show_name"]+" starting @ "+schedule["start"])
self.logger.info("Using 'randomized' playlist: "+json_response+" for "+id_name[:-3]+" for show "+schedule["show_name"]+" starting @ "+schedule["start"])