Skip to content

Commit

Permalink
test correct metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
JR-1991 committed Apr 28, 2024
1 parent 8266c4d commit 6d04bf2
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions tests/integration/test_native_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ def test_forced_native_upload(
assert len(files) == 3
assert sorted([file["label"] for file in files]) == sorted(expected_files)


def test_native_upload_by_handler(
self,
credentials,
Expand All @@ -116,8 +115,16 @@ def test_native_upload_by_handler(
# Arrange
byte_string = b"Hello, World!"
files = [
File(filepath="subdir/file.txt", handler=BytesIO(byte_string)),
File(filepath="biggerfile.txt", handler=BytesIO(byte_string*10000)),
File(
filepath="subdir/file.txt",
handler=BytesIO(byte_string),
description="This is a test",
),
File(
filepath="biggerfile.txt",
handler=BytesIO(byte_string * 10000),
description="This is a test",
),
]

# Create Dataset
Expand Down Expand Up @@ -154,5 +161,14 @@ def test_native_upload_by_handler(

file = next(file for file in files if file["label"] == ex_f)

assert file["label"] == ex_f, f"File label does not match for file {json.dumps(file)}"
assert file.get("directoryLabel", "") == ex_dir, f"Directory label does not match for file {json.dumps(file)}"
assert (
file["label"] == ex_f
), f"File label does not match for file {json.dumps(file)}"

assert (
file.get("directoryLabel", "") == ex_dir
), f"Directory label does not match for file {json.dumps(file)}"

assert (
file["description"] == "This is a test"
), f"Description does not match for file {json.dumps(file)}"

0 comments on commit 6d04bf2

Please sign in to comment.