# Path: exams/E2014/pakartotinis/u1/u1.py
# def read_ints(lines: Iterator[str]) -> List[int]:
# def get_director_item(lines: Iterator[str]) -> int:
# def get_employee_item(votes: List[int], director_item: int) -> int:
# def get_worst_item(worst_votes: List[int], director_item: int) -> int:
# def count_votes(lines: Iterator[str], director_item: int, n_items: int = 3) -> Tuple[List[int], int]:
# def main(path: Path) -> None:
# 
# Path: exams/testing.py
# def read(path: Path) -> List[str]:
#     return path.read_text().splitlines()
# 
# Path: exams/testing.py
# def write(path: Path, lines: List[str]) -> None:
#     path.write_text('\n'.join(lines))


from exams.E2014.pakartotinis.u1 import u1
from exams.testing import read
from exams.testing import write


def test(path):
    write(path / 'U1.txt', [
        '8',
        '2 1 3',
        '1 2 3',
        '3 3 2',
        '2 1 3',
        '2 3 2',
        '3 3 2',
        '2 2 2',
        '1 3 3',
        '2',
    ])
    u1.main(path)
    assert read(path / 'U1rez.txt') == [
        '2 4 2',
        '2',
    ]


def test_director_vote(path):

# Path: exams/E2014/pakartotinis/u1/u1.py
# def read_ints(lines: Iterator[str]) -> List[int]:
# def get_director_item(lines: Iterator[str]) -> int:
# def get_employee_item(votes: List[int], director_item: int) -> int:
# def get_worst_item(worst_votes: List[int], director_item: int) -> int:
# def count_votes(lines: Iterator[str], director_item: int, n_items: int = 3) -> Tuple[List[int], int]:
# def main(path: Path) -> None:
# 
# Path: exams/testing.py
# def read(path: Path) -> List[str]:
#     return path.read_text().splitlines()
# 
# Path: exams/testing.py
# def write(path: Path, lines: List[str]) -> None:
#     path.write_text('\n'.join(lines))


# Path: exams/E2014/pakartotinis/u1/tests.py
from exams.E2014.pakartotinis.u1 import u1
from exams.testing import read
from exams.testing import write



def test(path):
    write(path / 'U1.txt', [
        '8',
        '2 1 3',
        '1 2 3',
        '3 3 2',
        '2 1 3',
        '2 3 2',
        '3 3 2',
        '2 2 2',
        '1 3 3',
        '2',
    ])
    u1.main(path)
    assert read(path / 'U1rez.txt') == [
        '2 4 2',
        '2',
    ]


def test_director_vote(path):

    write(path / 'U1.txt', [