diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..147dfbc --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,15 @@ +name: Deploy + +on: + push: + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: '3.9.5' + - run: pip3 install -r requirements.txt + - run: pytest tests \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 083a9f5..dc9dcba 100644 --- a/requirements.txt +++ b/requirements.txt @@ -16,4 +16,5 @@ googletrans==4.0.0rc1 quart==0.15.1 Quart-CORS==0.5.0 attrs~=21.2.0 -dacite~=1.6.0 \ No newline at end of file +dacite~=1.6.0 +pytest==6.2.4 \ No newline at end of file diff --git a/tests/test_data/__init__.py b/tests/__init__.py similarity index 100% rename from tests/test_data/__init__.py rename to tests/__init__.py diff --git a/tests/data/__init__.py b/tests/data/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_data/test_regexes.py b/tests/data/test_regexes.py similarity index 100% rename from tests/test_data/test_regexes.py rename to tests/data/test_regexes.py diff --git a/tests/test_data/test_schedule.py b/tests/data/test_schedule.py similarity index 69% rename from tests/test_data/test_schedule.py rename to tests/data/test_schedule.py index 22916cc..34fbb3e 100644 --- a/tests/test_data/test_schedule.py +++ b/tests/data/test_schedule.py @@ -1,7 +1,6 @@ -import pytz - from data import schedule from datetime import datetime +import pytz import unittest @@ -17,11 +16,3 @@ class TestSchedule(unittest.TestCase): self.assertFalse(holiday.has_passed(before)) self.assertFalse(holiday.has_passed(during)) self.assertTrue(holiday.has_passed(after)) - - def test_course_str(self): - course = schedule.Course("Test") - self.assertEqual(str(course), "Test") - - def test_location_str(self): - location = schedule.Location("C", "B", "R") - self.assertEqual(str(location), "C B R") diff --git a/tests/test_data/test_snipe.py b/tests/data/test_snipe.py similarity index 100% rename from tests/test_data/test_snipe.py rename to tests/data/test_snipe.py diff --git a/tests/run_tests.py b/tests/run_tests.py deleted file mode 100644 index 4b64cea..0000000 --- a/tests/run_tests.py +++ /dev/null @@ -1,6 +0,0 @@ -import unittest - - -if __name__ == "__main__": - suite = unittest.TestLoader().discover('.', pattern="test_*.py") - unittest.TextTestRunner(verbosity=3).run(suite)