Skip to content

Commit

Permalink
Merge pull request #20 from branislavjenco/IS-10248
Browse files Browse the repository at this point in the history
[IS-10248] Fixed tests and added encoding
  • Loading branch information
ashkanvahidishams authored Dec 10, 2020
2 parents b31680d + 89ef76f commit ca95a60
Show file tree
Hide file tree
Showing 10 changed files with 57 additions and 10 deletions.
2 changes: 1 addition & 1 deletion install-latest.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
set -x
TAG=${SESAM_TAG:-1.18.2}
TAG=${SESAM_TAG:-1.18.3}

wget -O sesam.tar.gz https://github.com/sesam-community/sesam-py/releases/download/$TAG/sesam-linux-$TAG.tar.gz
tar -xf sesam.tar.gz
Expand Down
8 changes: 4 additions & 4 deletions sesam.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import pprint
from jsonformat import format_object

sesam_version = "1.18.2"
sesam_version = "1.18.3"

logger = logging.getLogger('sesam')
LOGLEVEL_TRACE = 2
Expand Down Expand Up @@ -730,7 +730,7 @@ def upload(self):
for filename in files:
pipe_id = filename.replace(".json", "")
try:
with open(os.path.join(root, filename), "r") as f:
with open(os.path.join(root, filename), "r", encoding="utf-8") as f:
entities_json = json.load(f)

if entities_json is not None:
Expand Down Expand Up @@ -1625,11 +1625,11 @@ def convert_pipe_config(pipe_config):

def save_testdata_file(pipe_id, entities):
os.makedirs("testdata", exist_ok=True)
with open(f"testdata{os.sep}{pipe_id}.json", "w") as testdata_file:
with open(f"testdata{os.sep}{pipe_id}.json", "w", encoding="utf-8") as testdata_file:
testdata_file.write(format_object(entities))

def save_modified_pipe(pipe_json, path):
with open(path, 'w') as pipe_file:
with open(path, 'w', encoding="utf-8") as pipe_file:
pipe_file.write(format_object(pipe_json))


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
"sesam-io": "http://data.sesam.io/schema/"
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
},
"condition": "test"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
"source": {
"type": "http_endpoint"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"_id": "input-pipe-norwegian",
"type": "pipe",
"description": "øæå",
"source": {
"type": "conditional",
"alternatives": {
"prod": {
"type": "dataset",
"dataset": "non_exists"
},
"test": {
"type": "embedded",
"entities": [{
"_id": "A",
"name": "øæå"
}, {
"_id": "B",
"name": "øæå"
}]
}
},
"condition": "test"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
"namespaced_identifiers": true,
"namespaces": {
"default": {
"_": "http://data.sesam.io/sesam",
"ad-department": "http://data.sesam.io/sesam/ad/department/",
"ad-user": "http://data.sesam.io/sesam/ad/user/",
"bouvet": "http://data.sesam.io/sesam/bouvet/",
"sesam-io": "http://data.sesam.io/schema/"
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
"source": {
"type": "http_endpoint"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"_id": "input-pipe-norwegian",
"type": "pipe",
"source": {
"type": "conditional",
"alternatives": {
"prod": {
"type": "dataset",
"dataset": "non_exists"
},
"test": {
"type": "http_endpoint"
}
},
"condition": "test"
},
"description": "øæå"
}

0 comments on commit ca95a60

Please sign in to comment.