From 655138bfa8583b874805370aeb30d4f59f59c8d1 Mon Sep 17 00:00:00 2001 From: Hoseong Son Date: Sat, 24 Nov 2018 19:36:18 +0900 Subject: [PATCH] Fix test --- test/test_convert.py | 62 ++++++++++++++++++++++++++++++++++++++++-- test/test_everytime.py | 13 --------- 2 files changed, 59 insertions(+), 16 deletions(-) delete mode 100644 test/test_everytime.py diff --git a/test/test_convert.py b/test/test_convert.py index 12d13d5..dc9cd47 100644 --- a/test/test_convert.py +++ b/test/test_convert.py @@ -9,16 +9,72 @@ class TestConvert(unittest.TestCase): + test_xml = ( + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '
' + '
' + ) + def test_get_subjects(self): - c = Convert("table.xml") + c = Convert(self.test_xml) self.assertGreater(len(c.get_subjects()), 0) def test_get_calendar(self): - c = Convert("table.xml") + c = Convert(self.test_xml) c.get_calendar(c.get_subjects(), "20180301", "20181231") def test_get_nearest_date(self): - c = Convert("table.xml") + c = Convert(self.test_xml) self.assertEqual(c.get_nearest_date(start_date="20180301", weekday=4), parser.parse("20180302")) if __name__ == '__main__': diff --git a/test/test_everytime.py b/test/test_everytime.py deleted file mode 100644 index 1967f33..0000000 --- a/test/test_everytime.py +++ /dev/null @@ -1,13 +0,0 @@ -import unittest - -from everytime import Everytime - - -class TestEveryTime(unittest.TestCase): - def test_get_request(self): - e = Everytime() - print(e.get_timetable('', '', '2017', '1')) - - -if __name__ == '__main__': - unittest.main()