Ejemplo n.º 1
0
def quit_start1():
    reset_pickle()
    big_bus.all_tickets = []
    big_bus.ticket.red_route_ticket = {}
    big_bus.ticket.ticket_id_num = 1000000
    BB1 = big_bus.Big_Bus()
    BB1.year = 2018
    BB1.month = 05
    BB1.day = 02
    BB1.route = "red"
    BB1.number_of_tickets = 2
    BB1.discount = False
    BB1.within_Date_Margin = True
    BB1.do_buy("")
    BB1.do_quit("")
    BB2 = big_bus.Big_Bus()
    BB2.year = 2018
    BB2.month = 05
    BB2.day = 05
    BB2.route = "blue"
    BB2.number_of_tickets = 3
    BB2.discount = False
    BB2.within_Date_Margin = True
    BB2.do_buy("")
    BB2.do_quit("")
Ejemplo n.º 2
0
def test_set_date2(date2):
    BB = big_bus.Big_Bus()
    BB.do_date(date2)
    assert BB.month == 05
    assert BB.day == 22
    assert BB.year == 2018
    assert BB.within_Date_Margin == False
Ejemplo n.º 3
0
def test_set_date1(date1):
    BB = big_bus.Big_Bus()
    BB.do_date(date1)
    assert BB.month == 05
    assert BB.day == 01
    assert BB.year == 2018
    assert BB.within_Date_Margin == True
Ejemplo n.º 4
0
def refund2():
    BB1 = big_bus.Big_Bus()
    BB1.year = 2018
    BB1.month = 05
    BB1.day = 02
    BB1.route = "red"
    BB1.number_of_tickets = 2
    BB1.discount = False
    BB1.within_Date_Margin = True
    return BB1
Ejemplo n.º 5
0
def big_bus3():
    BB = big_bus.Big_Bus()
    BB.year = 2018
    BB.month = 05
    BB.day = 02
    BB.route = "blue"
    BB.number_of_tickets = 4
    BB.discount = True
    BB.within_Date_Margin = True
    return BB
Ejemplo n.º 6
0
def buy3():
    BB = big_bus.Big_Bus()
    BB.year = 2018
    BB.month = 05
    BB.day = 01
    BB.route = ""
    BB.number_of_tickets = 1
    BB.discount = False
    BB.within_Date_Margin = True
    return BB
Ejemplo n.º 7
0
def test_route2(route2):
    BB = big_bus.Big_Bus()
    BB.do_route(route2)
    assert BB.route == "red"
Ejemplo n.º 8
0
def test_route1(route1):
    BB = big_bus.Big_Bus()
    BB.do_route(route1)
    assert BB.route == "green"
Ejemplo n.º 9
0
def test_startup1(quit_start1):
    BB1 = big_bus.Big_Bus()
    BB1.do_program_startup("")
    assert len(big_bus.all_tickets) == 5
    assert big_bus.ticket.red_route_ticket[datetime.date(2018, 05, 02)] == 2
    assert big_bus.ticket.blue_route_ticket[datetime.date(2018, 05, 05)] == 3
Ejemplo n.º 10
0
def test_buy_ticket4(ticket4):
    BB = big_bus.Big_Bus()
    tickets = BB.do_create_tickets(ticket4)
    assert BB.number_of_tickets == 0
    assert BB.discount == False
Ejemplo n.º 11
0
def test_buy_ticket2(ticket2):
    BB = big_bus.Big_Bus()
    tickets = BB.do_create_tickets(ticket2)
    assert BB.number_of_tickets == 4
    assert BB.discount == True
Ejemplo n.º 12
0
def test_route4(route4):
    BB = big_bus.Big_Bus()
    BB.do_route(route4)
    assert "This is not a valid route"
Ejemplo n.º 13
0
def test_route3(route3):
    BB = big_bus.Big_Bus()
    BB.do_route(route3)
    assert BB.route == "blue"