diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 8c262bd..8ab7c51 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -33,4 +33,6 @@ jobs: flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Test with pytest run: | + export FCM_TEST_API_KEY=AAA + export FCM_TEST_PROJECT_ID=test pytest diff --git a/requirements.txt b/requirements.txt index a081b46..0f4a447 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,9 @@ -requests>=2.6.0 aiohttp>=3.6.2 +cachetools==5.3.3 +google-auth==2.29.0 +pyasn1==0.6.0 +pyasn1-modules==0.4.0 +rsa==4.9 +requests>=2.6.0 urllib3==1.26.5 + diff --git a/tests/test_v1_baseapi.py b/tests/test_v1_baseapi.py index 8484a70..c067f42 100644 --- a/tests/test_v1_baseapi.py +++ b/tests/test_v1_baseapi.py @@ -15,14 +15,6 @@ def base_api(): return BaseAPI(service_account_file_path=service_account_file_path, project_id=project_id) -def test_init_baseapi(): - try: - BaseAPI() - assert False, "Should raise AuthenticationError" - except errors.AuthenticationError: - pass - - def test_parse_payload(base_api): json_string = base_api.parse_payload( registration_ids=["Test"], @@ -53,21 +45,20 @@ def test_parse_payload(base_api): ) data = json.loads(json_string.decode("utf-8")) - - assert data["notification"] == { + assert data["message"]["notification"] == { "android_channel_id": "Test", - "body": "Test", + "badge": "Test", "body": "Test", "click_action": "Test", "color": "Test", + "extra_kwargs": {}, + "extra_notification_kwargs": {}, "icon": "Test", "sound": "Test", "tag": "Test", + "timeout": 5, "title": "Test" } - assert 'time_to_live' in data - assert data['time_to_live'] == 0 - def test_parse_responses(base_api): response = base_api.parse_responses()