def main(filename=None): # here we create the seater object seater = Seater(1000) # and we read the file line by line, feeding each line to the Seater with open(filename, 'r') as f: for line in f: seater.seat(line.strip()) print('number of occupied seats', seater.number_occupied()) return
def main(filename=None): # here we create the seater object seater = Seater(1000) # and we read the file line by line, feeding each line to the Seater with open(filename, 'r') as f: for line in f: seater.seat(line.strip()) print 'number of occupied seats', seater.number_occupied() return
def test_toogle2(): # test if my function toogle is correct in occupying seats seater = Seater(size=5) seater.seat("occupy 0,0 through 4,4") seater.seat("empty 0,0 through 4,4") seater.seat("toggle 0,0 through 4,4") assert seater.number_occupied() == 25
def test_occupy(): # test if my function occupy is correct seater = Seater(size=5) seater.seat("occupy 0,0 through 4,4") seater.seat("empty 0,0 through 4,4") seater.seat("occupy 0,0 through 2,2") assert seater.number_occupied() == 9
def test_toogle2(): # test if my function toogle is correct in occupying seats seater = Seater(size=5) seater.seat("occupy 0,0 through 4,4") seater.seat("empty 0,0 through 4,4") seater.seat("toggle 0,0 through 4,4") assert seater.number_occupied()== 25
def test_occupy(): # test if my function occupy is correct seater = Seater(size=5) seater.seat("occupy 0,0 through 4,4") seater.seat("empty 0,0 through 4,4") seater.seat("occupy 0,0 through 2,2") assert seater.number_occupied()== 9
def test_number_occupied(): # test if my function number_occupied is correct seater = Seater(size=5) seater.seat("occupy 0,0 through 4,4") assert seater.number_occupied() == 25
def test_number_occupied(): # test if my function number_occupied is correct seater = Seater(size=5) seater.seat("occupy 0,0 through 4,4") assert seater.number_occupied()== 25