aboutsummaryrefslogtreecommitdiff
path: root/diplomacy/integration/webdiplomacy_net/tests/test_orders.py
diff options
context:
space:
mode:
authorPhilip Paquette <pcpaquette@gmail.com>2019-08-21 20:12:55 -0400
committerPhilip Paquette <pcpaquette@gmail.com>2019-08-21 20:45:22 -0400
commit22ae5e3672ff630e6db5159591e880b4ba1292cd (patch)
tree64ce28470c8b483955128b4d193d56df65ccee79 /diplomacy/integration/webdiplomacy_net/tests/test_orders.py
parent5c3bd9b3802e2001a7e77baf2911386135a03839 (diff)
[API] Disband order during 'A' phase strips the coast
Diffstat (limited to 'diplomacy/integration/webdiplomacy_net/tests/test_orders.py')
-rw-r--r--diplomacy/integration/webdiplomacy_net/tests/test_orders.py21
1 files changed, 20 insertions, 1 deletions
diff --git a/diplomacy/integration/webdiplomacy_net/tests/test_orders.py b/diplomacy/integration/webdiplomacy_net/tests/test_orders.py
index c2de6e8..71e055e 100644
--- a/diplomacy/integration/webdiplomacy_net/tests/test_orders.py
+++ b/diplomacy/integration/webdiplomacy_net/tests/test_orders.py
@@ -309,7 +309,7 @@ def test_disband_fleet_001():
assert compare_dicts(order_from_dict.to_dict(), order_dict)
def test_disband_fleet_coast_001():
- """ Tests disband fleet """
+ """ Tests disband fleet (retreats phase) """
raw_order = 'F SPA/NC D'
order_str = 'F SPA/NC D'
order_dict = {'terrID': 76,
@@ -327,6 +327,25 @@ def test_disband_fleet_coast_001():
assert order_from_dict.to_string() == order_str
assert compare_dicts(order_from_dict.to_dict(), order_dict)
+def test_disband_fleet_coast_002():
+ """ Tests disband fleet (adjustment phase)"""
+ raw_order = 'F SPA/NC D'
+ order_str = 'F SPA D'
+ order_dict = {'terrID': 8,
+ 'unitType': 'Fleet',
+ 'type': 'Destroy',
+ 'toTerrID': 8,
+ 'fromTerrID': '',
+ 'viaConvoy': ''}
+ order_from_string = Order(raw_order, phase_type='A')
+ order_from_dict = Order(order_dict, phase_type='A')
+
+ # Validating
+ assert order_from_string.to_string() == order_str
+ assert compare_dicts(order_from_string.to_dict(), order_dict)
+ assert order_from_dict.to_string() == order_str
+ assert compare_dicts(order_from_dict.to_dict(), order_dict)
+
def test_build_army_001():
""" Tests build army """
raw_order = 'A PAR B'