Skip to content

Commit

Permalink
fix env passing
Browse files Browse the repository at this point in the history
  • Loading branch information
TheManWhoLikesToCode committed Jan 15, 2024
1 parent df49faf commit f192ab2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/Unit-Tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ jobs:
pip install -r backend/requirements.txt
- name: Run tests
env:
TEST_USERNAME: ${{ secrets.TEST_USERNAME }}
TEST_PASSWORD: ${{ secrets.TEST_PASSWORD }}
run: |
python backend/test_blackboard_scraper.py --username ${{ secrets.TEST_USERNAME }} --password ${{ secrets.TEST_PASSWORD }}
python backend/test_blackboard_scraper.py
14 changes: 2 additions & 12 deletions backend/test_blackboard_scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,6 @@
from unittest.mock import patch
from usernames import usernames

# Create the parser
parser = argparse.ArgumentParser(description='Test BlackboardSession')

# Add the arguments
parser.add_argument('--username', type=str, help='Username for login')
parser.add_argument('--password', type=str, help='Password for login')

# Parse the arguments
args = parser.parse_args()

""""
Test Case Senarios:
Expand Down Expand Up @@ -75,8 +65,8 @@ class TestBlackboardSession(unittest.TestCase):

def setUp(self):
load_dotenv()
self.username = args.username if args.username else os.getenv('TEST_USERNAME')
self.password = args.password if args.password else os.getenv('TEST_PASSWORD')
self.username = os.environ.get('TEST_USERNAME')
self.password = os.environ.get('TEST_PASSWORD')

# * Login Tests *#

Expand Down

0 comments on commit f192ab2

Please sign in to comment.