Skip to content

Commit e18bc15

Browse files
Merge pull request #26 from mdsol/feature/protocol-test-suite-submodule
Add Protocol Test Suite as Submodule
2 parents 8f13123 + a99fc1e commit e18bc15

7 files changed

Lines changed: 22 additions & 14 deletions

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "tests/mauth-protocol-test-suite"]
2+
path = tests/mauth-protocol-test-suite
3+
url = https://github.com/mdsol/mauth-protocol-test-suite.git

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
dist: focal
12
language: python
23
cache: pip
34

CONTRIBUTING.md

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,24 @@ To setup your environment:
3535
pyenv local 3.5.8 3.6.10 3.7.7 3.8.2 pypy3.6-7.1.1
3636
```
3737

38-
## Unit Tests
3938

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

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

44-
## Running mauth-protocol-test-suite
46+
If you have already cloned before the submodule was introduced, then run:
47+
```sh
48+
cd tests/mauth-protocol-test-suite
49+
git submodule update --init
50+
```
4551

46-
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:
52+
to init the submodule.
4753

48-
```
49-
poetry run pytest -m protocol_suite
50-
```
54+
55+
## Unit Tests
56+
57+
1. Make any changes, update the tests and then run tests with `tox`
58+
1. Coverage report can be viewed using `open htmlcov/index.html`

pytest.ini

Lines changed: 0 additions & 3 deletions
This file was deleted.

tests/mauth-protocol-test-suite

tests/protocol_test_suite_helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
from mauth_client.signer import Signer
1010

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

tests/protocol_test_suite_test.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import pytest
21
import unittest
32
from unittest.mock import MagicMock
43
from freezegun import freeze_time
@@ -23,7 +22,6 @@ def tearDown(self):
2322
# reset the KeyHolder.get_public_key method
2423
KeyHolder.get_public_key = self.__get_public_key__
2524

26-
@pytest.mark.protocol_suite
2725
@freeze_time(TEST_SUITE.request_time)
2826
def test_protocol_test_suite(self):
2927
for case_path in TEST_SUITE.cases():

0 commit comments

Comments
 (0)