From 2255278b0e81fc20faff48536f524e1466046c8a Mon Sep 17 00:00:00 2001 From: Ben Connors Date: Sun, 29 Sep 2019 16:51:42 -0400 Subject: Update tests --- tests/test_functions_audio.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'tests/test_functions_audio.py') diff --git a/tests/test_functions_audio.py b/tests/test_functions_audio.py index 35d548a..5aaec5a 100644 --- a/tests/test_functions_audio.py +++ b/tests/test_functions_audio.py @@ -3,11 +3,14 @@ import pytest from blc2.functions.audio import Audio +from blc2.constants import BXW def test_audio(aws): a = Audio(aws) a.fade_out = 1000 + a.fade_out = 1000 + a.fade_in = 1000 a.fade_in = 1000 a.filename = "nonexistant" @@ -59,3 +62,17 @@ def test_audio(aws): a.filename = None assert a.duration == 0 assert a.actual_duration == 0 + +def test_audio_serialize(aws, test_xml_eq): + a1 = Audio(aws, id_=123, name="Test Audio 1", fade_out=100, filename="test.wav") + a2 = Audio(aws, id_=124, name="Test Audio 2", filename=None) + + test = (a1, a2) + success = [ +"""""", +"""""" + ] + + for case, s in zip(test, success): + s = s.replace('\n', "").format(BXW.strip("{}")) + assert test_xml_eq(case.serialize(), s) -- cgit v1.2.3