Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "tests/mauth-protocol-test-suite"]
path = tests/mauth-protocol-test-suite
url = https://github.com/mdsol/mauth-protocol-test-suite.git
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
dist: focal
language: python
cache: pip

Expand Down
24 changes: 16 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,24 @@ To setup your environment:
pyenv local 3.5.8 3.6.10 3.7.7 3.8.2 pypy3.6-7.1.1
```

## Unit Tests

1. Make any changes, update the tests and then run tests with `tox`
1. Coverage report can be viewed using `open htmlcov/index.html`
## Cloning the Repo

This repo contains the submodule `mauth-protocol-test-suite` so requires a flag when initially cloning in order to clone and init submodules:
```sh
git clone --recurse-submodules git@github.com:mdsol/mauth-client-python.git
```

## Running mauth-protocol-test-suite
If you have already cloned before the submodule was introduced, then run:
```sh
cd tests/mauth-protocol-test-suite
git submodule update --init
```

To run the mauth-protocol-test-suite clone the latest test suite onto your machine and place it in the [`tests`](./tests) directory (or supply the ENV var `TEST_SUITE_RELATIVE_PATH` with the path to the test suite relative to the `tests` directory). Then run:
to init the submodule.

```
poetry run pytest -m protocol_suite
```

## Unit Tests

1. Make any changes, update the tests and then run tests with `tox`
1. Coverage report can be viewed using `open htmlcov/index.html`
3 changes: 0 additions & 3 deletions pytest.ini

This file was deleted.

1 change: 1 addition & 0 deletions tests/mauth-protocol-test-suite
2 changes: 1 addition & 1 deletion tests/protocol_test_suite_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from mauth_client.signer import Signer

TEST_SUITE_RELATIVE_PATH = os.environ.get("TEST_SUITE_RELATIVE_PATH", "mauth-protocol-test-suite")
TEST_SUITE_RELATIVE_PATH = "mauth-protocol-test-suite"
MAUTH_PROTOCOL_DIR = os.path.join(os.path.dirname(__file__), TEST_SUITE_RELATIVE_PATH)
CASE_PATH = os.path.join(MAUTH_PROTOCOL_DIR, "protocols/MWSV2")

Expand Down
2 changes: 0 additions & 2 deletions tests/protocol_test_suite_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import pytest
import unittest
from unittest.mock import MagicMock
from freezegun import freeze_time
Expand All @@ -23,7 +22,6 @@ def tearDown(self):
# reset the KeyHolder.get_public_key method
KeyHolder.get_public_key = self.__get_public_key__

@pytest.mark.protocol_suite
@freeze_time(TEST_SUITE.request_time)
def test_protocol_test_suite(self):
for case_path in TEST_SUITE.cases():
Expand Down