Skip to content

Commit

Permalink
#1206 Indigo version hotfix (#1207)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitry Malysh authored Aug 4, 2023
1 parent bd166af commit 8bf2fcd
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 13 deletions.
14 changes: 14 additions & 0 deletions api/tests/integration/ref/basic/version.py.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
*** Testing string is valid json ***
True
*** Testing string contains 'majorVersion' key ***
True
*** Testing string contains 'minorVersion' key ***
True
*** Testing string contains 'devTag' key ***
True
*** Testing string contains 'commitHash' key ***
True
*** Testing string contains 'compilerVersion' key ***
True
*** Testing string contains 'compilerPlatform' key ***
True
21 changes: 8 additions & 13 deletions api/tests/integration/tests/basic/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,27 @@
indigo = Indigo()


def test_string_is_readable():
print("*** Testing string is readable ***")
try:
print(indigo.versionInfo())
except:
print("String can't be read")


def test_string_is_valid_json():
print("*** Testing string is valid json ***")
try:
json_object = json.loads(indigo.versionInfo())
print(json.dumps(json_object, indent=2))
json.loads(json.dumps(json_object, indent=2))
except:
print("String is not valid json")
print("False")
return
print("True")


def test_string_has_specific_key(key):
print("*** Testing string contains '{}' key ***".format(key))
try:
print(json.loads(indigo.versionInfo())[key])
json.loads(indigo.versionInfo())[key]
except:
print("String does not contain '{}' key".format(key))
print("False")
return
print("True")


test_string_is_readable()
test_string_is_valid_json()
test_string_has_specific_key("majorVersion")
test_string_has_specific_key("minorVersion")
Expand Down
19 changes: 19 additions & 0 deletions utils/indigo-service/backend/service/v2/indigo_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,25 @@ def info():
)


def versionInfo():
"""
Get information about Indigo version info
---
tags:
- indigo
responses:
200:
description: JSON with Indigo version
"""
indigo_api_logger.info("[REQUEST] /info")
indigo = indigo_init()
return (
jsonify({"Indigo": {"version_info": indigo.versionInfo()}}),
200,
{"Content-Type": "application/json"},
)


@indigo_api.route("/aromatize", methods=["POST"])
@check_exceptions
def aromatize():
Expand Down

0 comments on commit 8bf2fcd

Please sign in to comment.