Ejemplo n.º 1
0
def test(path):
    write(path / 'U2.txt', [
        '15',
        'Vilnius             Vilniaus     541278',
        'Dusetos             Utenos       4211',
        'Alytus              Alytaus      69859',
        'Druskininkai        Alytaus      16890',
        'Ignalina            Utenos       6307',
        'Kavarskas           Utenos       753',
        'Lazdijai            Alytaus      5027',
        'Simnas              Alytaus      1940',
        'Trakai              Vilniaus     5504',
        'Utena               Utenos       33086',
        'Veisiejai           Alytaus      1673',
        'Vievis              Vilniaus     5246',
        'Lentvaris           Vilniaus     11832',
        'Visaginas           Utenos       28438',
        'Zarasai             Utenos       8001 ',
    ])
    u2.main(path)
    assert read(path / 'U2rez.txt') == [
        '3',
        'Utenos        753 80796',
        'Alytaus       1673 95389',
        'Vilniaus      5246 563860',
    ]
Ejemplo n.º 2
0
def test_equal_case(path):
    write(path / 'U1.txt', [
        '2',
        '1 2 8 -8',
        '2 2 8 -9',
    ])
    u1.main(path)
    assert read(path / 'U1rez.txt') == ['1 2', '1 8', '2 9']
Ejemplo n.º 3
0
def test_a_pvz(path):
    write(path / 'U1.txt', [
        '2 3', '0 128 0', '255 0 0', '255 255 255', '255 255 0', '255 0 0',
        '255 255 0'
    ])
    u1.main(path)
    assert read(path / 'U1rez.txt') == [
        '008000;FF0000;FFFFFF', 'FFFF00;FF0000;FFFF00'
    ]
Ejemplo n.º 4
0
def test(path):
    write(path / 'U2.txt', [
        '2 3',
        'Hermis    6 1 2',
        'Hera      2 6 6',
    ])
    u2.main(path)
    assert read(path / 'U2rez.txt') == [
        'Hera      14',
    ]
Ejemplo n.º 5
0
def test_b_pvz(path):
    write(path / 'U1.txt', [
        '3',
        '3000',
        '3500',
        '2000',
    ])
    u1.main(path)
    assert read(path / 'U1rez.txt') == [
        '3500 0',
    ]
Ejemplo n.º 6
0
def test_director_vote(path):
    write(path / 'U1.txt', [
        '2',
        '1 2 3',
        '1 2 3',
        '2',
    ])
    u1.main(path)
    assert read(path / 'U1rez.txt') == [
        '2 0 0',
        '1',
    ]
Ejemplo n.º 7
0
def test(path):
    write(path / 'U1.txt', [
        '5 30',
        'Siuntuva  2 3',
        'Auda      3 -1',
        'Kostisa   -3 -2',
        'Linga     3 0',
        'Austuva   -2 -4',
    ])
    u1.main(path)
    assert read(path / 'U1rez.txt') == [
        '3 28 Kostisa',
    ]
Ejemplo n.º 8
0
def test(path):
    write(path / 'U1.txt', [
        '5 30',
        '2 3',
        '3 -1',
        '-2 -4',
        '-3 0',
        '-2 4',
    ])
    u1.main(path)
    assert read(path / 'U1rez.txt') == [
        '1 36',
    ]
Ejemplo n.º 9
0
def test_a_pvz(path):
    write(path / 'U1.txt', [
        '6',
        '5000',
        '4500',
        '5500',
        '3500',
        '10000',
        '5650',
    ])
    u1.main(path)
    assert read(path / 'U1rez.txt') == [
        '10000 3',
    ]
Ejemplo n.º 10
0
def test(path):
    write(path / 'U1.txt', [
        "11",
        "2 8 4 0",
        "3 1 0 9",
        "1 2 3 4",
        "5 4 14 2",
        "2 4 4 4",
        "3 0 0 0",
        "15 25 45 13",
        "28 13 13 13",
        "16 2 0 2",
        "16 5 15 25",
        "3 4 44 444",
    ])
    u1.main(path)
    assert read(path / 'U1rez.txt') == [
        '1 2 3 4',
        '2 12 8 4',
        '3 5 44 453',
        '5 4 14 2',
        '15 25 45 13',
        '16 7 15 27',
        '28 13 13 13',
        '3 502',
    ]
    u1_simple.main(path)
    assert read(path / 'U1rez.txt') == [
        '1 2 3 4',
        '2 12 8 4',
        '3 5 44 453',
        '5 4 14 2',
        '15 25 45 13',
        '16 7 15 27',
        '28 13 13 13',
        '3 502',
    ]
Ejemplo n.º 11
0
def test(path):
    write(path / 'U2.txt', [
        '5 -1',
        '8 -3',
        '3',
        '7 2 3 2 3 1 3 2',
        '2 1 4',
        '12 2 3 2 3 2 3 2 3 2 3 2 1',
    ])
    u2.main(path)
    assert read(path / 'U2rez.txt') == [
        'pasiektas tikslas    2 3 2 3 1 3 2 7',
        'sekos pabaiga        1 4 2',
        'pasiektas tikslas    2 3 2 3 2 5',
    ]
Ejemplo n.º 12
0
def test(path):
    write(path / 'U1.txt', [
        '5',
        'Z 14',
        'R 12',
        'G 20',
        'R 5',
        'R 6',
    ])
    u1.main(path)
    assert read(path / 'U1rez.txt') == [
        '7',
        'G = 6',
        'Z = 0',
        'R = 9',
    ]
Ejemplo n.º 13
0
def test(path):
    write(path / 'U1.txt', [
        '6',
        '15 10 22',
        '15 40 13',
        '23 26 26',
        '110 30 58',
        '33 33 32',
        '0 56 0',
        '2 1 3',
    ])
    u1.main(path)
    assert read(path / 'U1rez.txt') == [
        '196 195 151',
        '6 12 6',
        '2',
    ]
Ejemplo n.º 14
0
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',
    ]
Ejemplo n.º 15
0
def test(path):
    write(path / 'U1.txt', [
        '8',
        '9 5 7 -5 13 -4 11',
        '7 5 -3 12 -5 17 -3',
        '25 7 12 -3 5 -5 7 -5 3',
        '14 5 12 -3 10 -7 8',
        '5 1 -40',
        '33 5 15 -5 9 -3 8',
        '11 5 -12 8 -5 12 -3',
        '13 5 3 -4 25 -5 3',
    ])
    u1.main(path)
    assert read(path / 'U1rez.txt') == [
        '9 13 14 25 33',
        '33 32',
        '5 40',
    ]
Ejemplo n.º 16
0
def test(path):
    write(path / 'U2.txt', [
        '10',
        'prisitraukimai       10',
        'atsispaudimai        15',
        'atsilenkimai         12',
        'prisitraukimai       4',
        'atsilenkimai         15',
        'atsilenkimai         10',
        'prisitraukimai       12',
        'atsilenkimai         10',
        'atsispaudimai        2',
        'atsispaudimai        2',
    ])
    u2.main(path)
    assert read(path / 'U2rez.txt') == [
        'atsilenkimai         47',
        'prisitraukimai       26',
        'atsispaudimai        19',
    ]
Ejemplo n.º 17
0
def test(path: Path):
    write(path / 'U2.txt', [
        '6',
        'Petras A. Petraitis 15 20 00',
        'Jurgis Jurgutis     16 12 12',
        'Rimas Jonas         15 15 59',
        'Zigmas Nosis        16 23 9',
        'Romas Senasis       15 15 15',
        'Rytis Uosis Ainis   16 23 9',
        '5',
        'Zigmas Nosis        16 43 15',
        'Petras A. Petraitis 15 50 10',
        'Romas Senasis       16 5 35',
        'Rytis Uosis Ainis   16 55 59',
        'Jurgis Jurgutis     16 42 22',
    ])
    u2.main(path)
    assert read(path / 'U2rez.txt') == [
        'Zigmas Nosis        20 6',
        'Jurgis Jurgutis     30 10',
        'Petras A. Petraitis 30 10',
        'Rytis Uosis Ainis   32 50',
        'Romas Senasis       50 20',
    ]
Ejemplo n.º 18
0
def test(path):
    write(path / 'U1.txt', [
        '6',
        '10 7 6 4 3 1',
        '10 0 8 4 3 0',
        '4',
        '8 6 4 1',
        '1 1 50 0',
    ])
    u1.main(path)
    assert read(path / 'U1rez.txt') == [
        '8 21',
        '6 0',
        '4 1',
        '1 1',
        '23',
        '10 21',
        '7 0',
        '6 0',
        '4 1',
        '3 0',
        '1 0',
        '22',
    ]
Ejemplo n.º 19
0
def test(path, i, o):
    write(path / 'U1.txt', [i])
    u1.main(path)
    assert read(path / 'U1rez.txt') == [o]