Skip to content

Commit

Permalink
Fix assertion in tes_type_engine_binary_idl (#2801)
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas J. Fan <[email protected]>
  • Loading branch information
thomasjpfan authored and kumare3 committed Nov 8, 2024
1 parent e1bf83b commit f0e5d5c
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions tests/flytekit/unit/core/test_type_engine_binary_idl.py
Original file line number Diff line number Diff line change
Expand Up @@ -605,24 +605,24 @@ class DC:

@task
def t_inner(inner_dc: InnerDC):
assert (type(inner_dc), InnerDC) # type: ignore
assert type(inner_dc) is InnerDC

# f: List[FlyteFile]
for ff in inner_dc.f:
assert (type(ff), FlyteFile) # type: ignore
assert type(ff) is FlyteFile
with open(ff, "r") as f:
assert f.read() == "Hello FlyteFile"
# j: Dict[int, FlyteFile]
for _, ff in inner_dc.j.items():
assert (type(ff), FlyteFile) # type: ignore
assert type(ff) is FlyteFile
with open(ff, "r") as f:
assert f.read() == "Hello FlyteFile"
# n: FlyteFile
assert (type(inner_dc.n), FlyteFile) # type: ignore
assert type(inner_dc.n) is FlyteFile
with open(inner_dc.n, "r") as f:
assert f.read() == "Hello FlyteFile"
# o: FlyteDirectory
assert (type(inner_dc.o), FlyteDirectory) # type: ignore
assert type(inner_dc.o) is FlyteDirectory
assert not inner_dc.o.downloaded
with open(os.path.join(inner_dc.o, "file"), "r") as fh:
assert fh.read() == "Hello FlyteDirectory"
Expand Down Expand Up @@ -755,24 +755,24 @@ class DC:
enum_status: Status = field(default=Status.PENDING)

def t_inner(inner_dc: InnerDC):
assert (type(inner_dc), InnerDC) # type: ignore
assert type(inner_dc) is InnerDC

# f: List[FlyteFile]
for ff in inner_dc.f:
assert (type(ff), FlyteFile) # type: ignore
assert type(ff) is FlyteFile
with open(ff, "r") as f:
assert f.read() == "Hello FlyteFile"
# j: Dict[int, FlyteFile]
for _, ff in inner_dc.j.items():
assert (type(ff), FlyteFile) # type: ignore
assert type(ff) is FlyteFile
with open(ff, "r") as f:
assert f.read() == "Hello FlyteFile"
# n: FlyteFile
assert (type(inner_dc.n), FlyteFile) # type: ignore
assert type(inner_dc.n) is FlyteFile
with open(inner_dc.n, "r") as f:
assert f.read() == "Hello FlyteFile"
# o: FlyteDirectory
assert (type(inner_dc.o), FlyteDirectory) # type: ignore
assert type(inner_dc.o) is FlyteDirectory
assert not inner_dc.o.downloaded
with open(os.path.join(inner_dc.o, "file"), "r") as fh:
assert fh.read() == "Hello FlyteDirectory"
Expand Down

0 comments on commit f0e5d5c

Please sign in to comment.