Skip to content

Commit

Permalink
Debug is_s3_stored
Browse files Browse the repository at this point in the history
  • Loading branch information
znick committed Aug 30, 2022
1 parent 358c483 commit 5ffbf4b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions anytask/issues/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1136,6 +1136,7 @@ def test_rewrite_url_only_existing(self):
'''Note: updated model: {}, {}''').format(
expected_s3_path, file, expected_s3_path, file, expected_s3_path)
file = File.objects.get(pk=file.pk)
print(f">>>>>>>>>>>>>>>>>>>filename:{file.file.name} {S3OverlayStorage.is_s3_stored(file.file.name)}")
self.assertTrue(S3OverlayStorage.is_s3_stored(file.file.name))
self.assertTrue(self.s3_storage.exists(file.file.name))
self.assertEqual(expected_stdout, out.getvalue().strip())
Expand Down
3 changes: 3 additions & 0 deletions anytask/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ def _dispatch(self, name, method_name, *args, **kwargs):

@classmethod
def is_s3_stored(cls, name):
ret = name.lstrip('/').startswith(cls.S3_STORED_MAGIC + '/')
name_stripped = name.lstrip('/')
print(f"!!!!!!!!!! NAMAE:{name} {name_stripped} {ret}")
return name.lstrip('/').startswith(cls.S3_STORED_MAGIC + '/')

@classmethod
Expand Down

0 comments on commit 5ffbf4b

Please sign in to comment.