Skip to content

Commit

Permalink
fix: test_register for new wf structure
Browse files Browse the repository at this point in the history
  • Loading branch information
kennyworkman committed Mar 11, 2022
1 parent 7cbe09c commit 48461d7
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tests/test_register.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ def _setup_and_build_wo_dockerfile(jwt, pkg_name, requirements=None):

pkg_dir = Path(tmpdir).joinpath(pkg_name)
pkg_dir.mkdir()
pkg_dir.joinpath("wf").mkdir()

with open(pkg_dir.joinpath("__init__.py"), "w") as f:
with open(pkg_dir.joinpath("wf/__init__.py"), "w") as f:
f.write(_gen__init__(pkg_name))

with open(pkg_dir.joinpath("version"), "w") as f:
Expand All @@ -67,20 +68,21 @@ def _setup_and_build_w_dockerfile(jwt, pkg_name):

pkg_dir = Path(tmpdir).joinpath(pkg_name)
pkg_dir.mkdir()
pkg_dir.joinpath("wf").mkdir()

with open(pkg_dir.joinpath("__init__.py"), "w") as f:
with open(pkg_dir.joinpath("wf/__init__.py"), "w") as f:
f.write(_gen__init__(pkg_name))

with open(pkg_dir.joinpath("version"), "w") as f:
f.write(_VERSION_0)

dockerfile = Path(tmpdir).joinpath("Dockerfile")
dockerfile = Path(pkg_dir).joinpath("Dockerfile")
with open(dockerfile, "w") as df:
df.write(
"\n".join(
[
"FROM busybox",
f"COPY {pkg_name} /src/{pkg_name}",
"COPY wf /src/wf",
"WORKDIR /src",
]
)
Expand Down Expand Up @@ -146,7 +148,6 @@ def _setup_upload(pkg):
with tempfile.TemporaryDirectory() as tmpdir:
_serialize_pkg(ctx, tmpdir)
logs = _upload_pkg_image(ctx)
print("loglist: ", list(logs))
assert list(logs)[-1]["aux"]["Size"] > 0

_setup_upload("foo")
Expand Down

0 comments on commit 48461d7

Please sign in to comment.