mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
Core: Replace Clique with V6 in unit tests (#5181)
* replace Clique with V6 in unit tests * no hard mode in V6 * modify regex in copy_world to allow : str * oops * I see now * work around all typing * there actually needs to be something
This commit is contained in:
4
.github/workflows/build.yml
vendored
4
.github/workflows/build.yml
vendored
@@ -98,7 +98,7 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
cd build/exe*
|
cd build/exe*
|
||||||
cp Players/Templates/Clique.yaml Players/
|
cp Players/Templates/VVVVVV.yaml Players/
|
||||||
timeout 30 ./ArchipelagoGenerate
|
timeout 30 ./ArchipelagoGenerate
|
||||||
- name: Store 7z
|
- name: Store 7z
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
@@ -189,7 +189,7 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
cd build/exe*
|
cd build/exe*
|
||||||
cp Players/Templates/Clique.yaml Players/
|
cp Players/Templates/VVVVVV.yaml Players/
|
||||||
timeout 30 ./ArchipelagoGenerate
|
timeout 30 ./ArchipelagoGenerate
|
||||||
- name: Store AppImage
|
- name: Store AppImage
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
|
@@ -63,12 +63,12 @@ if __name__ == "__main__":
|
|||||||
spacer = '=' * 80
|
spacer = '=' * 80
|
||||||
|
|
||||||
with TemporaryDirectory() as tempdir:
|
with TemporaryDirectory() as tempdir:
|
||||||
multis = [["Clique"], ["Temp World"], ["Clique", "Temp World"]]
|
multis = [["VVVVVV"], ["Temp World"], ["VVVVVV", "Temp World"]]
|
||||||
p1_games = []
|
p1_games = []
|
||||||
data_paths = []
|
data_paths = []
|
||||||
rooms = []
|
rooms = []
|
||||||
|
|
||||||
copy_world("Clique", "Temp World")
|
copy_world("VVVVVV", "Temp World")
|
||||||
try:
|
try:
|
||||||
for n, games in enumerate(multis, 1):
|
for n, games in enumerate(multis, 1):
|
||||||
print(f"Generating [{n}] {', '.join(games)}")
|
print(f"Generating [{n}] {', '.join(games)}")
|
||||||
@@ -101,7 +101,7 @@ if __name__ == "__main__":
|
|||||||
with Client(host.address, game, "Player1") as client:
|
with Client(host.address, game, "Player1") as client:
|
||||||
local_data_packages = client.games_packages
|
local_data_packages = client.games_packages
|
||||||
local_collected_items = len(client.checked_locations)
|
local_collected_items = len(client.checked_locations)
|
||||||
if collected_items < 2: # Clique only has 2 Locations
|
if collected_items < 2: # Don't collect anything on the last iteration
|
||||||
client.collect_any()
|
client.collect_any()
|
||||||
# TODO: Ctrl+C test here as well
|
# TODO: Ctrl+C test here as well
|
||||||
|
|
||||||
@@ -125,7 +125,7 @@ if __name__ == "__main__":
|
|||||||
with Client(host.address, game, "Player1") as client:
|
with Client(host.address, game, "Player1") as client:
|
||||||
web_data_packages = client.games_packages
|
web_data_packages = client.games_packages
|
||||||
web_collected_items = len(client.checked_locations)
|
web_collected_items = len(client.checked_locations)
|
||||||
if collected_items < 2: # Clique only has 2 Locations
|
if collected_items < 2: # Don't collect anything on the last iteration
|
||||||
client.collect_any()
|
client.collect_any()
|
||||||
if collected_items == 1:
|
if collected_items == 1:
|
||||||
sleep(1) # wait for the server to collect the item
|
sleep(1) # wait for the server to collect the item
|
||||||
|
@@ -34,7 +34,7 @@ def _generate_local_inner(games: Iterable[str],
|
|||||||
f.write(json.dumps({
|
f.write(json.dumps({
|
||||||
"name": f"Player{n}",
|
"name": f"Player{n}",
|
||||||
"game": game,
|
"game": game,
|
||||||
game: {"hard_mode": "true"},
|
game: {},
|
||||||
"description": f"generate_local slot {n} ('Player{n}'): {game}",
|
"description": f"generate_local slot {n} ('Player{n}'): {game}",
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
@@ -30,7 +30,7 @@ def copy(src: str, dst: str) -> None:
|
|||||||
_new_worlds[dst] = str(dst_folder)
|
_new_worlds[dst] = str(dst_folder)
|
||||||
with open(dst_folder / "__init__.py", "r", encoding="utf-8-sig") as f:
|
with open(dst_folder / "__init__.py", "r", encoding="utf-8-sig") as f:
|
||||||
contents = f.read()
|
contents = f.read()
|
||||||
contents = re.sub(r'game\s*=\s*[\'"]' + re.escape(src) + r'[\'"]', f'game = "{dst}"', contents)
|
contents = re.sub(r'game\s*(:\s*[a-zA-Z\[\]]+)?\s*=\s*[\'"]' + re.escape(src) + r'[\'"]', f'game = "{dst}"', contents)
|
||||||
with open(dst_folder / "__init__.py", "w", encoding="utf-8") as f:
|
with open(dst_folder / "__init__.py", "w", encoding="utf-8") as f:
|
||||||
f.write(contents)
|
f.write(contents)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user