Skip to content

Commit

Permalink
add filetype (#584)
Browse files Browse the repository at this point in the history
* add filetype

* Bump version: 1.3.11 → 1.3.12
  • Loading branch information
alexcos20 committed Dec 15, 2022
1 parent 724f1ab commit 843e520
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 1.3.11
current_version = 1.3.12
commit = True
tag = True

Expand Down
2 changes: 1 addition & 1 deletion ocean_provider/routes/consume.py
Expand Up @@ -123,7 +123,7 @@ def fileinfo():

file_instance = message
valid, details = file_instance.check_details(with_checksum=with_checksum)
info = {"index": i, "valid": valid}
info = {"index": i, "valid": valid, "type": file["type"]}
info.update(details)
files_info.append(info)

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -107,7 +107,7 @@
url="https://github.com/oceanprotocol/provider-py",
# fmt: off
# bumpversion needs single quotes
version='1.3.11',
version='1.3.12',
# fmt: on
zip_safe=False,
)
3 changes: 3 additions & 0 deletions tests/test_fileinfo.py
Expand Up @@ -91,6 +91,7 @@ def test_checksums(client):
assert response.status == "200 OK"
for file_info in result:
assert file_info["valid"] is True
assert file_info["type"] == "url"
assert (
file_info["checksum"]
== "1f7c17bed455f484f4d5ebc581cde6bc059977ef1e143b52a703f18b89c86a22"
Expand All @@ -108,6 +109,7 @@ def test_checksums(client):
assert response.status == "200 OK"
for file_info in result:
assert file_info["valid"] is True
assert file_info["type"] == "ipfs"
assert "checksum" not in file_info
assert "checksumType" not in file_info

Expand Down Expand Up @@ -153,6 +155,7 @@ def test_check_arweave_good(client):
assert file_info["contentLength"] == "5311"
assert file_info["contentType"] == "application/octet-stream"
assert file_info["valid"] is True
assert file_info["type"] == "arweave"


@pytest.mark.unit
Expand Down

0 comments on commit 843e520

Please sign in to comment.