Skip to content

Commit

Permalink
Add more unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardobranco777 committed Aug 13, 2023
1 parent 04de0d6 commit ced7394
Show file tree
Hide file tree
Showing 5 changed files with 380 additions and 135 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FILES=*.py
FILES=*.py tests/*.py

.PHONY: all
all: flake8 pylint pytest mypy
Expand All @@ -17,7 +17,7 @@ pytest:

.PHONY: mypy
mypy:
@mypy .
@mypy $(FILES)

.PHONY: e2e
e2e:
Expand Down
4 changes: 2 additions & 2 deletions clean_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def run_command(command: list) -> int:
return proc.wait()


def clean_registry(images: list[str], dry_run: bool = False) -> None:
def clean_registrydir(images: list[str], dry_run: bool = False) -> None:
'''Clean registry'''
registry_dir = os.environ.get("REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY", "/var/lib/registry")
logging.debug("registry directory: %s", registry_dir)
Expand Down Expand Up @@ -158,7 +158,7 @@ def main():
fmt = "%(asctime)s %(levelname)-8s %(message)s"
logging.basicConfig(format=fmt, stream=sys.stderr, level=args.log.upper())

clean_registry(images=args.images, dry_run=args.dry_run)
clean_registrydir(images=args.images, dry_run=args.dry_run)


if __name__ == "__main__":
Expand Down
1 change: 1 addition & 0 deletions requirements-test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
flake8
pylint
pytest
pytest-mock
mypy
131 changes: 0 additions & 131 deletions tests/clean_registry_test.py

This file was deleted.

Loading

0 comments on commit ced7394

Please sign in to comment.