# Path: diplomacy/engine/main.py
# def normalize_orders(turn, orders, units, owns):
# def update_retreats(orders, units):
# def update_movements(orders, units):
# def update_adjusts(orders, units):
# def update_autodisbands(orders, units, owns):
# def update_ownership(units, owns):
# def increment_turn(turn):
# def generate(turn, orders, units, owns):
# def initialize_game():
#         T = get_territory(u['subregion'])
#         T = get_territory(u['subregion'])
#         T = get_territory(u['previous'])
#         T = get_territory(u['subregion'])


from django.test import TestCase
from django.utils import six
from ..engine import main

    def test_fleet_on_coast(self):
        units = [
            {'government': 'austria-hungary',
             'u_type': 'F',
             'subregion': 'bulgaria.sc.s',
             'previous': 'greece.s',
             'dislodged': False,
             'displaced_from': '',
             'standoff_from': ''}
        ]
        owns = []

        new_owns = main.update_ownership(units, owns)

        self.assertCountEqual(new_owns,
                              [{'territory': 'bulgaria', 'government': 'austria-hungary'}])

    def test_fleet_on_sea(self):
        units = [
            {'government': 'italy',
             'u_type': 'F',
             'subregion': 'ionian-sea.s',
             'previous': 'naples.s',
             'dislodged': False,
             'displaced_from': '',
             'standoff_from': ''}
        ]
        owns = []


# Path: diplomacy/engine/main.py
# def normalize_orders(turn, orders, units, owns):
# def update_retreats(orders, units):
# def update_movements(orders, units):
# def update_adjusts(orders, units):
# def update_autodisbands(orders, units, owns):
# def update_ownership(units, owns):
# def increment_turn(turn):
# def generate(turn, orders, units, owns):
# def initialize_game():
#         T = get_territory(u['subregion'])
#         T = get_territory(u['subregion'])
#         T = get_territory(u['previous'])
#         T = get_territory(u['subregion'])


# Path: diplomacy/tests/test_main.py
from django.test import TestCase
from django.utils import six
from ..engine import main


    def test_fleet_on_coast(self):
        units = [
            {'government': 'austria-hungary',
             'u_type': 'F',
             'subregion': 'bulgaria.sc.s',
             'previous': 'greece.s',
             'dislodged': False,
             'displaced_from': '',
             'standoff_from': ''}
        ]
        owns = []

        new_owns = main.update_ownership(units, owns)

        self.assertCountEqual(new_owns,
                              [{'territory': 'bulgaria', 'government': 'austria-hungary'}])

    def test_fleet_on_sea(self):
        units = [
            {'government': 'italy',
             'u_type': 'F',
             'subregion': 'ionian-sea.s',
             'previous': 'naples.s',
             'dislodged': False,
             'displaced_from': '',
             'standoff_from': ''}
        ]
        owns = []


        new_owns = main.update_ownership(units, owns)