Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions codestripper/code_stripper.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ def strip_files(files: Iterable[str], working_directory: Union[str, None] = None

cwd = get_working_directory(working_directory)
out = os.path.join(os.getcwd(), output)
if os.path.isdir(out):
shutil.rmtree(out)

stripped_files: List[str] = []
has_errors: bool = False
for file in files:
Expand Down
21 changes: 18 additions & 3 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "codestripper"
version = "1.1.2"
version = "1.2.0"
description = "CodeStripper used to strip code from assignments"
authors = ["Bonajo <m.bonajo@fontys.nl>"]
maintainers = ["Bonajo <m.bonajo@fontys.nl>"]
Expand Down
9 changes: 0 additions & 9 deletions tests/test_codestripper.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,6 @@ def test_log_invalid_tag(monkeypatch: pytest.MonkeyPatch, caplog: LogCaptureFixt
assert len(errors) == 1 and "InvalidTag.java" in errors[0] and "2" in errors[0]


def test_project_out_removes(monkeypatch: pytest.MonkeyPatch):
monkeypatch.chdir(test_project_dir)
files = FileUtils(["**/*.java", "pom.xml"], working_directory="testproject").get_matching_files()
strip_files(files, "testproject", output="out")
files = FileUtils(["pom.xml"], working_directory="testproject").get_matching_files()
strip_files(files, "testproject", output="out")
assert not os.path.isdir(Path("out/src"))


def test_fail_on_error(monkeypatch: pytest.MonkeyPatch, caplog: pytest.LogCaptureFixture):
monkeypatch.chdir(test_project_dir)
files = FileUtils(["**/*.java"], working_directory="files").get_matching_files()
Expand Down