-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Added in initial unit tests for ROMParser and ROMChooser
- Loading branch information
Showing
6 changed files
with
144 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
dirs: | ||
raw_dir: '.' | ||
rom_dir: '.' | ||
dat_dir: '.' | ||
parsed_dat_dir: '.' | ||
dupe_dir: '.' | ||
log_dir: '.' | ||
cache_dir: '.' | ||
|
||
platforms: | ||
- Nintendo - Super Nintendo Entertainment System | ||
|
||
region_preferences: | ||
- USA | ||
|
||
language_preferences: | ||
- English | ||
|
||
include_games: | ||
SNES: | ||
- "Chrono Trigger" | ||
|
||
romsearch: | ||
method: "filter_then_download" | ||
run_romdownloader: true | ||
run_datparser: true | ||
run_dupeparser: true | ||
run_romchooser: true | ||
run_rommover: false | ||
dry_run: false | ||
|
||
romdownloader: | ||
dry_run: false | ||
remote_name: 'rclone_remote' | ||
sync_all: false | ||
|
||
dupeparser: | ||
use_dat: true | ||
use_retool: true | ||
|
||
gamefinder: | ||
filter_dupes: true | ||
|
||
romparser: | ||
use_dat: false | ||
use_retool: false | ||
use_filename: true | ||
|
||
romchooser: | ||
dry_run: false | ||
use_best_version: true | ||
allow_multiple_regions: false | ||
filter_regions: true | ||
filter_languages: true | ||
bool_filters: "all_but_games" | ||
|
||
discord: | ||
webhook_url: "https://discord.com/api/webhooks/discord_url" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from romsearch import ROMParser, ROMChooser | ||
|
||
TEST_NAME = "Example Game (USA) (En,De,Fr)" | ||
|
||
|
||
def test_romchooser_version(): | ||
"""Put a number of versions through and check ROMChooser gets the right one""" | ||
|
||
test_case = { | ||
TEST_NAME: {"priority": 1}, | ||
f"{TEST_NAME} (v1.00)": {"priority": 1}, | ||
f"{TEST_NAME} (v2.00)": {"priority": 1}, | ||
} | ||
|
||
rp = ROMParser(config_file="test_config.yml", | ||
platform="Nintendo - Super Nintendo Entertainment System", | ||
game="Example Game", | ||
) | ||
rom_dict = rp.run(test_case) | ||
|
||
rc = ROMChooser(config_file="test_config.yml", | ||
platform="Nintendo - Super Nintendo Entertainment System", | ||
game="Example Game", | ||
) | ||
rom_dict = rc.run(rom_dict) | ||
|
||
roms_found = [r for r in rom_dict] | ||
|
||
assert roms_found == ["Example Game (USA) (En,De,Fr) (v2.00)"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
from romsearch import ROMParser | ||
|
||
TEST_NAME = "Example Game (USA) (En,De,Fr)" | ||
|
||
|
||
def test_romparser_regions(): | ||
"""Put a filename into ROMParser and check it returns the right regions""" | ||
|
||
expected_regions = ["USA"] | ||
|
||
test_case = {TEST_NAME: {"priority": 1}} | ||
|
||
rp = ROMParser(config_file="test_config.yml", | ||
platform="Nintendo - Super Nintendo Entertainment System", | ||
game="Example Game", | ||
) | ||
roms_parsed = rp.run(test_case) | ||
|
||
assert roms_parsed[TEST_NAME]["regions"] == expected_regions | ||
|
||
|
||
def test_romparser_languages(): | ||
"""Put a filename into ROMParser and check it returns the right languages""" | ||
|
||
expected_languages = ["English", "French", "German"] | ||
|
||
test_case = {TEST_NAME: {"priority": 1}} | ||
|
||
rp = ROMParser(config_file="test_config.yml", | ||
platform="Nintendo - Super Nintendo Entertainment System", | ||
game="Example Game", | ||
) | ||
roms_parsed = rp.run(test_case) | ||
|
||
assert roms_parsed[TEST_NAME]["languages"] == expected_languages |