Skip to content

Commit 2604a0b

Browse files
committed
reorg tests; kill commented code blocks; detox;
1 parent 08072c9 commit 2604a0b

File tree

3 files changed

+14
-65
lines changed

3 files changed

+14
-65
lines changed

serverless.yml

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -151,26 +151,3 @@ functions:
151151
# - test
152152
# - prod
153153

154-
# resources:
155-
# Resources:
156-
# ToshiBucket:
157-
# Type: AWS::S3::Bucket
158-
# Properties:
159-
# BucketName: ${self:custom.s3_bucket}
160-
161-
# # following on from
162-
# # https://www.serverless.com/blog/build-geosearch-graphql-api-aws-appsync-elasticsearch
163-
# ElasticSearchInstance:
164-
# Type: AWS::Elasticsearch::Domain
165-
# Properties:
166-
# ElasticsearchVersion: 6.2
167-
# DomainName: "${self:custom.esDomainName}"
168-
# EBSOptions:
169-
# EBSEnabled: true
170-
# VolumeType: gp2
171-
# VolumeSize: 10
172-
# ElasticsearchClusterConfig:
173-
# InstanceType: t2.small.elasticsearch
174-
# InstanceCount: 1
175-
# DedicatedMasterEnabled: false
176-
# ZoneAwarenessEnabled: false

tests/test_schema_model_source_logic_tree.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,6 @@ def client():
1111
return Client(schema.schema_root)
1212

1313

14-
def test_get_model_default(client):
15-
QUERY = """
16-
query {
17-
get_model
18-
{
19-
version
20-
}
21-
}
22-
"""
23-
executed = client.execute(QUERY)
24-
print(executed)
25-
assert executed["data"]["get_model"]["version"] == "NSHM_v1.0.4"
26-
27-
2814
@pytest.mark.parametrize(
2915
"model_version",
3016
["NSHM_v1.0.0", "NSHM_v1.0.4"],

tests/test_schema_models.py

Lines changed: 14 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import pytest
22
from graphene.test import Client
3-
from graphql_relay import to_global_id
43

54
from nshm_model_graphql_api import schema
65

@@ -23,6 +22,20 @@ def test_get_models(client):
2322
assert executed["data"]["get_models"][0]["version"] == "NSHM_v1.0.0"
2423

2524

25+
def test_get_model_default(client):
26+
QUERY = """
27+
query {
28+
get_model
29+
{
30+
version
31+
}
32+
}
33+
"""
34+
executed = client.execute(QUERY)
35+
print(executed)
36+
assert executed["data"]["get_model"]["version"] == "NSHM_v1.0.4"
37+
38+
2639
@pytest.mark.parametrize(
2740
"model_version",
2841
["NSHM_v1.0.0", "NSHM_v1.0.4"],
@@ -47,30 +60,3 @@ def test_get_model(client, model_version):
4760
print(executed)
4861
assert executed["data"]["get_model"]["version"] == model_version
4962
assert executed["data"]["get_model"]["__typename"] == "NshmModel"
50-
51-
52-
@pytest.mark.parametrize(
53-
"model_version",
54-
["NSHM_v1.0.0", "NSHM_v1.0.4"],
55-
)
56-
def test_get_model_as_node(client, model_version):
57-
QUERY = """
58-
query {
59-
node(id: "%s")
60-
{
61-
... on Node {
62-
id
63-
}
64-
... on NshmModel {
65-
version
66-
}
67-
68-
}
69-
}
70-
""" % to_global_id(
71-
"NshmModel", model_version
72-
)
73-
executed = client.execute(QUERY)
74-
print(executed)
75-
assert executed["data"]["node"]["version"] == model_version
76-
assert executed["data"]["node"]["id"] == to_global_id("NshmModel", model_version)

0 commit comments

Comments
 (0)