Fix tests

This commit is contained in:
Kyle Robbertze 2020-01-22 12:14:40 +02:00
parent 6213604341
commit e8a0783139
8 changed files with 20 additions and 79 deletions

View file

@ -125,7 +125,7 @@ class PypoLiquidsoap():
scheduled_now_webstream = \
[x for x in scheduled_now if x["type"] == eventtypes.STREAM_OUTPUT_START]
schedule_ids = {x["row_id"] for x in scheduled_now_files]}
schedule_ids = [x["row_id"] for x in scheduled_now_files]
row_id_map = {}
liq_queue_ids = set()

View file

@ -1,18 +0,0 @@
#!/bin/bash
which py.test
pytest_exist=$?
if [ "$pytest_exist" != "0" ]; then
echo "Need to have py.test installed. Exiting..."
exit 1
fi
SCRIPT=`readlink -f $0`
# Absolute directory this script is in
SCRIPTPATH=`dirname $SCRIPT`
export PYTHONPATH=$PYTHONPATH:$SCRIPTPATH/..:$SCRIPTPATH/../..
py.test

View file

@ -1,26 +0,0 @@
from pypopush import PypoPush
from threading import Lock
from queue import Queue
import datetime
pypoPush_q = Queue()
telnet_lock = Lock()
pp = PypoPush(pypoPush_q, telnet_lock)
def test_modify_cue_in():
link = pp.modify_first_link_cue_point([])
assert len(link) == 0
min_ago = datetime.datetime.utcnow() - datetime.timedelta(minutes = 1)
link = [{"start":min_ago.strftime("%Y-%m-%d-%H-%M-%S"),
"cue_in":"0", "cue_out":"30"}]
link = pp.modify_first_link_cue_point(link)
assert len(link) == 0
link = [{"start":min_ago.strftime("%Y-%m-%d-%H-%M-%S"),
"cue_in":"0", "cue_out":"70"}]
link = pp.modify_first_link_cue_point(link)
assert len(link) == 1