diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 0fb7a27..417538b 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -29,10 +29,14 @@ jobs: python -m pip install --upgrade pip pip install flake8 pytest if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Test Community IDCard Update + run: | + cd idcard_update + python -m unittest - name: Change Titles env: REDDIT_CLIENT_ID: ${{ secrets.REDDIT_CLIENT_ID }} REDDIT_CLIENT_SECRET: ${{ secrets.REDDIT_CLIENT_SECRET }} REDDIT_PASSWORD: ${{ secrets.REDDIT_PASSWORD }} run: | - python main.py + python idcard_update/main.py diff --git a/README.md b/README.md index 57f0abe..3e1ec9f 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ ## Scripts -### [main.py](https://github.com/developersIndia/deviras/blob/main/main.py) +### [idcard_update](https://github.com/developersIndia/deviras/blob/idcard_update) Used for changing the text below total members & live members count in a subreddit. diff --git a/idcard_update/__init__.py b/idcard_update/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/dataset.json b/idcard_update/dataset.json similarity index 100% rename from dataset.json rename to idcard_update/dataset.json diff --git a/main.py b/idcard_update/main.py similarity index 100% rename from main.py rename to idcard_update/main.py diff --git a/test_get_titles.py b/idcard_update/test_get_titles.py similarity index 99% rename from test_get_titles.py rename to idcard_update/test_get_titles.py index 89a417d..0130dbf 100644 --- a/test_get_titles.py +++ b/idcard_update/test_get_titles.py @@ -1,5 +1,6 @@ import unittest from unittest.mock import patch +from main import get_titles # patch out the environ dictionary # used to instantiate global variables in the titles_updater script @@ -11,8 +12,6 @@ environ_patcher = patch.dict('os.environ', { }) environ_patcher.start() -from main import get_titles - class TestGetTitles(unittest.TestCase): @patch('main.json.load', return_value={'titles': ['foo', 'bar', 'baz']}) def test_get_titles_returns_a_list(self, _):