Skip to content

Commit

Permalink
#99 moved actual backup into own method to make it testable by unit t…
Browse files Browse the repository at this point in the history
…ests
  • Loading branch information
ephes committed Aug 14, 2023
1 parent c95bb6d commit b695b0a
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions tests/management_command_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,14 @@ def test_media_backup_with_wrong_django_version(mocker):


class StubStorage:
_files: list[str] = []
_exists: list[str] = []
def __init__(self):
self._files = []

def exists(self, path):
return path in self._exists
return path in self._files

def save(self, name, _content):
print("save called: ", name, _content)
self._exists.append(name)
self._files.append(name)

@staticmethod
def open(name, _mode):
Expand Down

0 comments on commit b695b0a

Please sign in to comment.