Exemple #1
0
 def test_encode_decode(self):
     for ticket_value in TICKET_VALUES:
         encoded = ticket.encode(ticket_value)
         decoded = ticket.decode(encoded)
         self.assertEquals(ticket_value, decoded)
Exemple #2
0
def test_decode_ticket():
    assert {
        'row': 11,
        'class': 12,
        'seat': 13
    } == ticket.decode('16/test_input_2.txt')
Exemple #3
0
 def verify_ticket(self, ticket_id):
     vm = self.get_vending_machine()
     vm.verify(ticket.decode(ticket_id))
     assert os.path.exists(self.get_ticket_filename(ticket_id))
Exemple #4
0
 def test_encode_decode(self):
     for ticket_value in TICKET_VALUES:
         encoded = ticket.encode(ticket_value)
         decoded = ticket.decode(encoded)
         self.assertEquals(ticket_value, decoded)