forked from robinostlund/volkswagencarnet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
637 additions
and
204 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
-r requirements.txt | ||
pytest>=7.0.0 | ||
setuptools | ||
pytest-asyncio | ||
black | ||
flake8 | ||
flake8-docstrings | ||
freezegun>=1.0.0 | ||
pre-commit | ||
pytest>=7.0.0 | ||
pytest-asyncio | ||
pytest-cov | ||
pytest-subtests | ||
black | ||
freezegun>=1.0.0 | ||
setuptools |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
lxml | ||
beautifulsoup4 | ||
aiohttp | ||
beautifulsoup4 | ||
lxml | ||
pyjwt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
"""Configure tests.""" | ||
import sys | ||
|
||
pytest_plugins = ["pytest_cov"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,14 @@ | ||
"""Dummy tests. Might be removed once there are proper ones.""" | ||
import pytest | ||
from aiohttp import ClientSession | ||
|
||
# we need to change os path to be able to import volkswagecarnet | ||
from volkswagencarnet import vw_connection | ||
|
||
|
||
@pytest.mark.asyncio | ||
async def test_volkswagencarnet(): | ||
"""Dummy test to ensure logged in status is false by default.""" | ||
async with ClientSession() as session: | ||
connection = vw_connection.Connection(session, "[email protected]", "test_password") | ||
# if await connection._login(): | ||
if not connection.logged_in: | ||
return True | ||
pytest.fail("Something happend we should have got a False from vw.logged_in") | ||
assert connection.logged_in is False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
"""Misc tests for exception and their handling.""" | ||
from unittest import TestCase | ||
|
||
from volkswagencarnet.vw_exceptions import AuthenticationException | ||
|
||
|
||
class ExceptionTests(TestCase): | ||
"""Unit tests for exceptions.""" | ||
|
||
def test_auth_exception(self): | ||
"""Test that message matches. Dummy test.""" | ||
ex = AuthenticationException("foo failed") | ||
self.assertEqual("foo failed", ex.__str__()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.