From 8441dedcf5583ca09e7081c44d2018d18cd2857d Mon Sep 17 00:00:00 2001 From: AndriiPidlisnyi Date: Tue, 12 Jul 2022 20:21:26 +0300 Subject: [PATCH 1/3] Setup unit tests. --- Makefile | 3 +++ tests/__init__.py | 0 tests/test_extend.py | 14 ++++++++++++++ 3 files changed, 17 insertions(+) create mode 100644 tests/__init__.py create mode 100644 tests/test_extend.py 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 From 8f5c33a43787a10b66926ee3d440898a5275bc71 Mon Sep 17 00:00:00 2001 From: AndriiPidlisnyi Date: Wed, 13 Jul 2022 13:11:44 +0300 Subject: [PATCH 2/3] Empty commit. From 033432c4a53b06804df9be51c4ffa9481791e784 Mon Sep 17 00:00:00 2001 From: AndriiPidlisnyi Date: Wed, 13 Jul 2022 13:58:30 +0300 Subject: [PATCH 3/3] Fix Makefile. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 5f7cc70..2a6c550 100644 --- a/Makefile +++ b/Makefile @@ -5,4 +5,4 @@ test: cd integration_tests && docker-compose down && docker-compose run --rm tests unittest: - pytest tests/ \ No newline at end of file + pytest tests/