I have tried to fix this with some substitutions simalar to how date is handled but I failed to make it work. Here are my latest substitutions I have made in case anyone will try to fix it:
diff --git a/tests/test_xml.py b/tests/test_xml.py
index 38a8a45..1b9b740 100644
--- a/tests/test_xml.py
+++ b/tests/test_xml.py
@@ -2,9 +2,11 @@
import datetime
import difflib
import ly.musicxml
+import ly.pkginfo
from lxml import etree
import os
import io
+import re
def test_glissando():
@@ -85,7 +87,9 @@ def read_expected_xml(filename):
with open(filename, 'r') as xmlfile:
output = xmlfile.read()
# Replace date in XML file with today's date
- output = output.replace("2016-03-28", str(datetime.date.today()))
+ output = output.replace("utf-8", "UTF-8")
+ output = re.sub("python-ly \d.\d.\d", ly.pkginfo.name + " " + ly.pkginfo.version, output)
+ output = re.sub(r'201\d-\d{2}-\d{2}', str(datetime.date.today()), output)
return output
--
I wasn't there, but I'm guessing these tests were a failed experiment? No way they are going to work if the expected output includes the encoding-date...
Test suit generealy does not work in latest version with following output (Only for the first test, the rest is pretty the same):
This is because
StringIO.getvalue()
returs string. I changed it toBytesIO
with following patch:but tests fail with following errors:
I have tried to fix this with some substitutions simalar to how date is handled but I failed to make it work. Here are my latest substitutions I have made in case anyone will try to fix it: