def test_a_pvz(path): (path / 'U1.txt').write('2 3', '0 128 0', '255 0 0', '255 255 255', '255 255 0', '255 0 0', '255 255 0') u1.main(path) assert (path / 'U1rez.txt').read() == [ '008000;FF0000;FFFFFF', 'FFFF00;FF0000;FFFF00' ]
def test_equal_case(path): (path / 'U1.txt').write( '2', '1 2 8 -8', '2 2 8 -9', ) u1.main(path) assert (path / 'U1rez.txt').read() == ['1 2', '1 8', '2 9']
def test_b_pvz(path): (path / 'U1.txt').write( '3', '3000', '3500', '2000', ) u1.main(path) assert (path / 'U1rez.txt').read() == [ '3500 0', ]
def test(self): u1.main() with open('U1rez.txt') as f: lines = f.read().splitlines() self.assertEqual(lines, [ '3 28 Kostisa', ]) os.unlink('U1rez.txt')
def test(path): (path / 'Duom1.txt').write( '3', '2 15 41', '4 1 2 3 4', '3 22 11 24', ) u1.main(path) assert (path / 'Rez1.txt').read() == [ '17.08', ]
def test_director_vote(path): (path / 'U1.txt').write( '2', '1 2 3', '1 2 3', '2', ) u1.main(path) assert (path / 'U1rez.txt').read() == [ '2 0 0', '1', ]
def test(path): (path / 'U1.txt').write( '5 30', 'Siuntuva 2 3', 'Auda 3 -1', 'Kostisa -3 -2', 'Linga 3 0', 'Austuva -2 -4', ) u1.main(path) assert (path / 'U1rez.txt').read() == [ '3 28 Kostisa', ]
def test(self): u1.main() with open('U1rez.txt') as f: lines = f.read().splitlines() self.assertEqual(lines, [ '196 195 151', '6 12 6', '2', ]) os.unlink('U1rez.txt')
def test(self): u1.main() with open('U1rez.txt') as f: lines = f.read().splitlines() self.assertEqual(lines, [ '9 13 14 25 33', '33 32', '5 40', ]) os.unlink('U1rez.txt')
def test(path): (path / 'U1.txt').write( '5 30', '2 3', '3 -1', '-2 -4', '-3 0', '-2 4', ) u1.main(path) assert (path / 'U1rez.txt').read() == [ '1 36', ]
def test_a_pvz(path): (path / 'U1.txt').write( '6', '5000', '4500', '5500', '3500', '10000', '5650', ) u1.main(path) assert (path / 'U1rez.txt').read() == [ '10000 3', ]
def test(path): (path / 'U1.txt').write( '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 (path / 'U1rez.txt').read() == [ '196 195 151', '6 12 6', '2', ]
def test(path): (path / 'U1.txt').write( '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 (path / 'U1rez.txt').read() == [ '9 13 14 25 33', '33 32', '5 40', ]
def test(path): (path / 'U1.txt').write( '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 (path / 'U1rez.txt').read() == [ '2 4 2', '2', ]
def test(path, u1_data): for i, o in u1_data: (path/'U1.txt').write(i) u1.main(path) assert (path/'U1rez.txt').read() == [o]