From 420bddb09517a097ae931a056bb9b1310d346af2 Mon Sep 17 00:00:00 2001 From: Thomas Lauf Date: Fri, 11 May 2018 18:47:03 +0200 Subject: [PATCH] #138 Added tests --- test/export.t | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/test/export.t b/test/export.t index 1b8ee9b8..9c8306da 100755 --- a/test/export.t +++ b/test/export.t @@ -180,6 +180,28 @@ class TestExport(TestCase): self.assertIn('1221Z', j[1]['start']) self.assertFalse('end' in j[1]) + def test_export_with_tag_with_spaces(self): + """Interval with tag with spaces""" + self.t("track 20160531T0800 - 20160531T0900 \"tag with spaces\"") + + j = self.t.export() + self.assertEqual(len(j), 1) + self.assertTrue('start' in j[0]) + self.assertTrue('end' in j[0]) + self.assertTrue('tags' in j[0]) + self.assertEqual(j[0]['tags'][0], 'tag with spaces') + + def test_export_with_tag_with_quote(self): + """Interval with tag with quote""" + self.t("track 20160531T0800 - 20160531T0900 \"tag with \\\"quote\"") + + j = self.t.export() + self.assertEqual(len(j), 1) + self.assertTrue('start' in j[0]) + self.assertTrue('end' in j[0]) + self.assertTrue('tags' in j[0]) + self.assertEqual(j[0]['tags'][0], 'tag with "quote') + if __name__ == "__main__": from simpletap import TAPTestRunner