diff --git a/.github/workflows/Unit-Tests.yml b/.github/workflows/Unit-Tests.yml index 9c96b32..cd5b10f 100644 --- a/.github/workflows/Unit-Tests.yml +++ b/.github/workflows/Unit-Tests.yml @@ -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 diff --git a/backend/test_blackboard_scraper.py b/backend/test_blackboard_scraper.py index ea471b1..6c43642 100644 --- a/backend/test_blackboard_scraper.py +++ b/backend/test_blackboard_scraper.py @@ -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: @@ -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 *#