mirror of
https://github.com/developersIndia/deviras.git
synced 2024-12-22 16:19:50 +05:30
move script to module
This commit is contained in:
parent
9f78c6f611
commit
f5ec4f6592
6
.github/workflows/python-app.yml
vendored
6
.github/workflows/python-app.yml
vendored
@ -29,10 +29,14 @@ jobs:
|
|||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
pip install flake8 pytest
|
pip install flake8 pytest
|
||||||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
|
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
|
- name: Change Titles
|
||||||
env:
|
env:
|
||||||
REDDIT_CLIENT_ID: ${{ secrets.REDDIT_CLIENT_ID }}
|
REDDIT_CLIENT_ID: ${{ secrets.REDDIT_CLIENT_ID }}
|
||||||
REDDIT_CLIENT_SECRET: ${{ secrets.REDDIT_CLIENT_SECRET }}
|
REDDIT_CLIENT_SECRET: ${{ secrets.REDDIT_CLIENT_SECRET }}
|
||||||
REDDIT_PASSWORD: ${{ secrets.REDDIT_PASSWORD }}
|
REDDIT_PASSWORD: ${{ secrets.REDDIT_PASSWORD }}
|
||||||
run: |
|
run: |
|
||||||
python main.py
|
python idcard_update/main.py
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
## Scripts
|
## 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.
|
Used for changing the text below total members & live members count in a subreddit.
|
||||||
|
|
||||||
|
0
idcard_update/__init__.py
Normal file
0
idcard_update/__init__.py
Normal file
@ -1,5 +1,6 @@
|
|||||||
import unittest
|
import unittest
|
||||||
from unittest.mock import patch
|
from unittest.mock import patch
|
||||||
|
from main import get_titles
|
||||||
|
|
||||||
# patch out the environ dictionary
|
# patch out the environ dictionary
|
||||||
# used to instantiate global variables in the titles_updater script
|
# used to instantiate global variables in the titles_updater script
|
||||||
@ -11,8 +12,6 @@ environ_patcher = patch.dict('os.environ', {
|
|||||||
})
|
})
|
||||||
environ_patcher.start()
|
environ_patcher.start()
|
||||||
|
|
||||||
from main import get_titles
|
|
||||||
|
|
||||||
class TestGetTitles(unittest.TestCase):
|
class TestGetTitles(unittest.TestCase):
|
||||||
@patch('main.json.load', return_value={'titles': ['foo', 'bar', 'baz']})
|
@patch('main.json.load', return_value={'titles': ['foo', 'bar', 'baz']})
|
||||||
def test_get_titles_returns_a_list(self, _):
|
def test_get_titles_returns_a_list(self, _):
|
Loading…
Reference in New Issue
Block a user