Skip to content

Commit

Permalink
implement minor changes requested
Browse files Browse the repository at this point in the history
  • Loading branch information
maaikelimper committed Jan 22, 2024
1 parent ecefa69 commit 831e77a
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 21 deletions.
1 change: 0 additions & 1 deletion docker_compose_test/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ services:
- test.env
build:
context: ./../
dockerfile: Dockerfile
depends_on:
elasticsearch:
condition: service_healthy
Expand Down
4 changes: 2 additions & 2 deletions docker_compose_test/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
requests
paho-mqtt
pytest
pytest
requests
16 changes: 6 additions & 10 deletions docker_compose_test/tests/integration/test_wis2box.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@
# .github/workflows/wis2box_test.yml has been executed

import json
import os
import time

import requests
import os

import paho.mqtt.client as mqtt

Expand Down Expand Up @@ -90,11 +91,8 @@ def transform_to_bufr(process_name: str,
response = requests.get(f'{job_location_url}/results?f=json', headers=headers) # noqa
response_json = response.json()
# print(response_json)
assert response_json['result'] == expected_response['result']
assert response_json['messages transformed'] == expected_response['messages transformed'] # noqa
assert response_json['messages published'] == expected_response['messages published'] # noqa
assert response_json['errors'] == expected_response['errors']
assert response_json['warnings'] == expected_response['warnings']
for key in ['result', 'messages transformed', 'messages published', 'errors', 'warnings']: # noqa
assert response_json[key] == expected_response[key]

filename = data['inputs']['channel'].replace('/', '_') + '.json'

Expand All @@ -118,10 +116,8 @@ def transform_to_bufr(process_name: str,
}

# compare the received message with the expected message
assert message['channel'] == expected_message['channel']
assert message['filename'] == expected_message['filename']
assert message['data'] == expected_message['data']
assert message['_meta'] == expected_message['_meta']
for key in ['channel', 'filename', 'data', '_meta']:
assert message[key] == expected_message[key]


def test_synop2bufr():
Expand Down
1 change: 1 addition & 0 deletions wis2box_api/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from copy import deepcopy
import os
import json

import json_merge_patch
from jsonschema.exceptions import ValidationError
import logging
Expand Down
3 changes: 1 addition & 2 deletions wis2box_api/plugins/process/bufr2bufr.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,13 @@
#
###############################################################################

import logging
import base64
import logging

from pygeoapi.process.base import BaseProcessor

from wis2box_api.wis2box.handle import handle_error
from wis2box_api.wis2box.handle import DataHandler

from wis2box_api.wis2box.bufr4 import ObservationDataBUFR

LOGGER = logging.getLogger(__name__)
Expand Down
3 changes: 2 additions & 1 deletion wis2box_api/plugins/process/bufr2geojson.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@
#
###############################################################################

import base64
import logging

import requests
import base64

from pygeoapi.process.base import BaseProcessor
from bufr2geojson import transform as as_geojson
Expand Down
5 changes: 2 additions & 3 deletions wis2box_api/plugins/process/csv2bufr.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
#
###############################################################################

import json
import logging
import os

from pygeoapi.process.base import BaseProcessor

Expand All @@ -31,9 +33,6 @@

from csv2bufr import transform as transform_csv

import json
import os

LOGGER = logging.getLogger(__name__)

PROCESS_METADATA = {
Expand Down
3 changes: 2 additions & 1 deletion wis2box_api/wis2box/bufr4.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@
#
###############################################################################

from datetime import datetime
import logging
import tempfile

from datetime import datetime

from bufr2geojson import BUFRParser
from eccodes import (
codes_bufr_copy_data,
Expand Down
2 changes: 1 addition & 1 deletion wis2box_api/wis2box/station.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
# under the License.
#
###############################################################################
import csv

import csv
import io
import logging

Expand Down

0 comments on commit 831e77a

Please sign in to comment.