Skip to content

Commit

Permalink
debug code
Browse files Browse the repository at this point in the history
  • Loading branch information
pjbull committed Nov 25, 2023
1 parent c452df2 commit 11e0069
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion tests/mock_clients/mock_s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,18 @@ def download_file(self, to_path, Config=None, ExtraArgs=None):
sleep(0.2)
waits -= 1

to_path.write_bytes(self.path.read_bytes())
if not to_path.parent.exists():
print("PARENT NEVER CREATED??")
to_path.parent.mkdir(parents=True, exist_ok=True)

try:
to_path.write_bytes(self.path.read_bytes())
except FileNotFoundError as e:
exists_root = to_path
while not exists_root.exists():
exists_root = exists_root.parent
raise FileNotFoundError(f"{to_path} does not exist; {exists_root} does")

# track config to make sure it's used in tests
self.resource.download_config = Config
self.resource.download_extra_args = ExtraArgs
Expand Down

0 comments on commit 11e0069

Please sign in to comment.