From 1fa977c926520c4e284465f73e75bfe9982d9fdf Mon Sep 17 00:00:00 2001 From: Philip Paquette Date: Mon, 10 Jun 2019 10:27:01 -0400 Subject: Using OrderResults to indicate the correct order results during adjudication - Modified DATC tests for consistency --- diplomacy/tests/test_game.py | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'diplomacy/tests/test_game.py') diff --git a/diplomacy/tests/test_game.py b/diplomacy/tests/test_game.py index cec1df7..1c2a6fe 100644 --- a/diplomacy/tests/test_game.py +++ b/diplomacy/tests/test_game.py @@ -19,6 +19,7 @@ """ from copy import deepcopy from diplomacy.engine.game import Game +from diplomacy.utils.order_results import BOUNCE def test_is_game_done(): """ Tests if the game is done """ @@ -218,12 +219,12 @@ def test_get_order_status(): game.set_orders('AUSTRIA', 'A VIE - TYR') game.process() results = game.get_order_status() - assert 'bounce' in results['ITALY']['A VEN'] - assert 'bounce' in results['AUSTRIA']['A VIE'] - assert 'bounce' in game.get_order_status(unit='A VEN') - assert 'bounce' in game.get_order_status(unit='A VIE') - assert 'bounce' in game.get_order_status('ITALY')['A VEN'] - assert 'bounce' in game.get_order_status('AUSTRIA')['A VIE'] + assert BOUNCE in results['ITALY']['A VEN'] + assert BOUNCE in results['AUSTRIA']['A VIE'] + assert BOUNCE in game.get_order_status(unit='A VEN') + assert BOUNCE in game.get_order_status(unit='A VIE') + assert BOUNCE in game.get_order_status('ITALY')['A VEN'] + assert BOUNCE in game.get_order_status('AUSTRIA')['A VIE'] def test_set_units(): """ Test - Sets units """ @@ -297,8 +298,8 @@ def test_set_orders(): game.process() results = game.get_order_status() - assert 'bounce' in results['ITALY']['A VEN'] - assert 'bounce' in results['AUSTRIA']['A VIE'] + assert BOUNCE in results['ITALY']['A VEN'] + assert BOUNCE in results['AUSTRIA']['A VIE'] def test_set_orders_replace(): """ Test - Sets orders with replace=True """ @@ -530,8 +531,8 @@ def test_process_game(): game.set_orders('AUSTRIA', 'A VIE - TYR') game.process() results = game.get_order_status() - assert 'bounce' in results['ITALY']['A VEN'] - assert 'bounce' in results['AUSTRIA']['A VIE'] + assert BOUNCE in results['ITALY']['A VEN'] + assert BOUNCE in results['AUSTRIA']['A VIE'] def test_deepcopy(): """ Tests - deepcopy """ @@ -647,8 +648,8 @@ def test_result_history(): game.process() assert game.current_short_phase == 'F1901M' phase_data = game.get_phase_from_history(short_phase_name) - assert 'bounce' in phase_data.results['A PAR'] - assert 'bounce' in phase_data.results['A MAR'] + assert BOUNCE in phase_data.results['A PAR'] + assert BOUNCE in phase_data.results['A MAR'] def test_unit_owner(): """ Test Unit Owner Resolver making sure the cached results are correct """ -- cgit v1.2.3