Skip to content

Commit

Permalink
Dropped some WIP tests, to be added back with full functionality later.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaspersiebring committed Jul 25, 2023
1 parent 89fec2a commit 9b7da0c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 48 deletions.
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 = "libretro-finder"
version = "0.1.2"
version = "0.1.3"
description = "Command line utility that looks for specific BIOS files for libretro cores and, if found, refactors them to the expected format (i.e. name and directory structure)."
authors = ["Jasper <j.siebring92@gmail.com>"]
license = "GNU General Public License v3.0"
Expand Down
48 changes: 1 addition & 47 deletions tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,50 +126,4 @@ def test_same_input(
assert len(output_paths) == current_len
assert bios_lut.shape[0] == len(output_paths)
assert np.all(np.isin(output_hashes, bios_lut["md5"].values))
assert np.all(np.isin(bios_lut["name"].values, output_names))

# def test_permissions(
# self, setup_files, tmpdir_factory: TempdirFactory, monkeypatch: MonkeyPatch
# ) -> None:
# bios_dir, bios_lut = setup_files
# assert bios_dir.exists()

# # checking saved files (excluding directories)
# file_paths = list(bios_dir.rglob("*"))
# file_paths = [file_path for file_path in file_paths if file_path.is_file()]
# assert len(file_paths) == TEST_SAMPLE_SIZE

# # making output_dir but with read-only permissions
# temp_dir = tmpdir_factory.mktemp("test_permissions")
# output_dir = pathlib.Path(temp_dir)
# print(stat.filemode(os.stat(str(temp_dir)).st_mode))
# os.chmod(str(temp_dir), 0o555)
# print(stat.filemode(os.stat(str(temp_dir)).st_mode))

# # checking if currently empty
# output_paths = list(output_dir.rglob(pattern="*"))
# assert len(output_paths) == 0

# # swapping out system_df to the one generated from setup_files
# # this is needed because we can't include actual bios files for testing
# monkeypatch.setattr("libretro_finder.main.system_df", bios_lut)
# organize(search_dir=bios_dir, output_dir=output_dir, glob="*")
# output_dir

# # verifying correct output
# output_paths = list(output_dir.rglob(pattern="*"))
# output_paths = [
# output_path for output_path in output_paths if output_path.is_file()
# ]
# output_names = [
# output_path.relative_to(output_dir).as_posix()
# for output_path in output_paths
# ]
# output_hashes = [hash_file(output_path) for output_path in output_paths]

# assert len(output_paths) == TEST_SAMPLE_SIZE
# assert bios_lut.shape[0] == len(output_paths)
# assert np.all(np.isin(output_hashes, bios_lut["md5"].values))
# assert np.all(np.isin(bios_lut["name"].values, output_names))

# def test_argparser
assert np.all(np.isin(bios_lut["name"].values, output_names))

0 comments on commit 9b7da0c

Please # to comment.