Skip to content
Snippets Groups Projects
Commit 16d8489d authored by Sabine Schröder's avatar Sabine Schröder
Browse files

preparing everything for CI pytest. Is it possible to have PostgreSQL/PostGIS running on zam347?

parent 38717b35
No related branches found
No related tags found
No related merge requests found
Pipeline #39003 failed
stages:
- test
- deploy
- pages
......@@ -7,6 +8,20 @@ cache:
paths:
- public/docs/
#### Test ####
test:
stage: test
tags:
- leap
- zam347
- base
script:
- zypper --non-interactive install python3-pip
- pip install --upgrade pip
- pip install --no-cache-dir -r requirements.txt
- chmod +x ./CI/do_pytest.sh
- ./CI/do_pytest.sh
#### Documentation ####
docs:
stage: deploy
......
#!/usr/bin/env bash
# run make command
for MOD in contacts data stationmeta timeseries variables
do
pytest toardb/$MOD
done
......@@ -162,8 +162,8 @@ class TestApps:
def test_insert_new(self, client, db):
response = client.post("/stationmeta_core/",
json={"stationmeta_core":
response = client.post("/stationmeta/",
json={"stationmeta":
{"codes":["ttt3","ttt4"],
"name":"Test_China","coordinates":{"lat":36.256,"lng":117.106,"alt":1534.0},
"country":"China","state":"Shandong Sheng","coordinate_validation_status":0,
......@@ -179,13 +179,15 @@ class TestApps:
'country': 'China', 'state': 'Shandong Sheng', 'coordinate_validation_status': 0,
'coordinate_validation_date': '2020-03-11T12:22:18.047974+01:00', 'type_of_environment': 0,
'type_of_area': 0, 'category': '', 'timezone': '',
'additional_metadata': {}, 'coordinate_validator_id': 1}
'additional_metadata': {}, 'coordinate_validator_id': 1,
'roles': [], 'annotations': [], 'aux_images': [], 'aux_docs': [], 'aux_urls': [],
'globalmeta': None, 'globalservice': None}
assert response.json() == expected_resp
def test_insert_duplicate(self, client, db):
response = client.post("/stationmeta_core/",
json={"stationmeta_core":
response = client.post("/stationmeta/",
json={"stationmeta":
{"codes":["China11"],
"name":"Test_China","coordinates":{"lat":36.256,"lng":117.106,"alt":1534.0},
"country":"China","state":"Shandong Sheng","coordinate_validation_status":0,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment