diff --git a/.circleci/config.yml b/.circleci/config.yml index 275ac92..ea4b65a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -15,6 +15,10 @@ jobs: name: Build command: make build + - run: + name: Tests + command: make unittest + - run: name: Tests command: make test diff --git a/Makefile b/Makefile index 0660860..5f7cc70 100644 --- a/Makefile +++ b/Makefile @@ -3,3 +3,6 @@ build: test: cd integration_tests && docker-compose down && docker-compose run --rm tests + +unittest: + pytest tests/ \ No newline at end of file diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_extend.py b/tests/test_extend.py new file mode 100644 index 0000000..507de75 --- /dev/null +++ b/tests/test_extend.py @@ -0,0 +1,14 @@ +from graphene import Int, String + +from graphene_federation.extend import external, requires + + +def test_external(): + field = external(Int(required=True)) + assert field._external is True + + +def test_requires(): + fields = 'primaryEmail' + field = requires(String(), fields=fields) + assert field._requires == fields