Skip to content

Commit cc628fb

Browse files
committed
Create stage for testing
1 parent fe6fc8e commit cc628fb

7 files changed

Lines changed: 4 additions & 7 deletions

File tree

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,3 @@ package-lock.json
1111
# config files
1212
config.yaml
1313
.env
14-
stage

app.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ def collection(id, path):
114114
format = request.args.get("format")
115115
html_wanted = "html" in request.headers["Accept"] or format == "html"
116116

117+
# TODO: make stage optional
117118
stage_base = app.config.get("stage")
118119
stage_path = os.path.join(stage_base, 'collection',
119120
str(id)) if stage_base else None

lib/config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ def __init__(self, file=None, debug=False):
3838
else:
3939
self.data = {}
4040

41-
self.data["stage"] = os.getenv('STAGE', 'stage')
41+
if not self.get("stage", None):
42+
self.data["stage"] = os.getenv('STAGE', 'stage')
4243
if not self.data.get("sparql", None):
4344
self.data["sparql"] = {
4445
"endpoint": os.getenv('SPARQL', "http://localhost:3030/n4o")

requirements.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
typing_extensions
2-
portion
3-
jsonpath_ng
4-
neo4j
51
Flask
62
waitress
73
pytest
@@ -10,4 +6,3 @@ pyyaml
106
rdflib
117
SPARQLWrapper
128
python-mimeparse
13-

tests/stage/collection/.keep

Whitespace-only changes.

tests/stage/terminology/.keep

Whitespace-only changes.

tests/test_app.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ def client():
88
app.testing = True
99

1010
config = Config()
11+
config["stage"] = "tests/stage"
1112
# data = Path(__file__).parent
1213
# init(title="N4O Graph Import API TEST",
1314
# stage=stage, sparql=sparqlApi, data=data)

0 commit comments

Comments
 (0)