SHARE
TWEET

all_test

a guest Feb 18th, 2020 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from application import *
  2. import hashlib
  3. import flight
  4.  
  5.  
  6. ###
  7. # SETUP INSTRUCTIONS:
  8. # STEP 1: In Folder 'starter_code' > create a folder > ulitmate_testing_suite_a1 > Save this file underneath it as
  9. # 'Test_Multi_Agent_Fingerprint_Suite.py'
  10. # STEP 2: Add your tester name
  11. ###
  12. def deep_fingerprint_trip_id():
  13.     input_data_small = import_data('../data/airports.csv',
  14.                                    '../data/customers.csv',
  15.                                    '../data/segments_small.csv',
  16.                                    '../data/trips_small.csv')
  17.     input_data_big = import_data('../data/airports.csv',
  18.                                  '../data/customers.csv',
  19.                                  '../data/segments.csv', '../data/trips.csv')
  20.     small_string = ''
  21.     big_sting = ''
  22.     airports = create_airports(input_data_small[0])
  23.     customers = create_customers(input_data_small[2])
  24.  
  25.     flights_small = create_flight_segments(input_data_small[1])
  26.     trips_small = load_trips(input_data_small[3], customers, flights_small)
  27.  
  28.     flights_big = create_flight_segments(input_data_big[1])
  29.     trips_big = load_trips(input_data_big[3], customers, flights_big)
  30.  
  31.     for t in trips_small:
  32.         small_string += t.get_reservation_id() + str(t.trip_departure) + f'{t.get_in_flight_time()}{t.get_in_flight_time()}{round(t.get_total_trip_time())}'
  33.         for s in t.get_flight_segments():
  34.             small_string += str(s.seat_availability)
  35.             for element in s._manifest:
  36.                 small_string += str(element)
  37.  
  38.     for t in trips_big:
  39.         big_sting += t.get_reservation_id() + str(t.trip_departure) + f'{t.get_in_flight_time()}{t.get_in_flight_time()}{round(t.get_total_trip_time())}'
  40.         for s in t.get_flight_segments():
  41.             big_sting += str(s.seat_availability)
  42.             for element in s._manifest:
  43.                 big_sting += str(element)
  44.  
  45.     c_info = ''
  46.     for cid, cust in customers.items():
  47.         c_info += f'{cid}{cust.get_miles()}{cust.get_ff_status()}{round(cust.all_flight_costs)}'
  48.     return small_string, big_sting, c_info
  49.  
  50.  
  51. def deep_fingerprint_trip_id_limited():
  52.     input_data_small = import_data('../data/airports.csv',
  53.                                    '../data/customers.csv',
  54.                                    '../data/segments_small.csv',
  55.                                    '../data/trips_small.csv')
  56.     input_data_big = import_data('../data/airports.csv',
  57.                                  '../data/customers.csv',
  58.                                  '../data/segments.csv', '../data/trips.csv')
  59.     small_limited = ''
  60.     big_limited = ''
  61.     airports = create_airports(input_data_small[0])
  62.     customers = create_customers(input_data_small[2]) # type: Dict[int, Customer]
  63.  
  64.     flight.AIRPLANE_CAPACITY = {"Economy": 2, "Business": 1}
  65.     flights_small = create_flight_segments(input_data_small[1])
  66.     trips_small = load_trips(input_data_small[3], customers, flights_small)
  67.  
  68.     flights_big = create_flight_segments(input_data_big[1])
  69.     trips_big = load_trips(input_data_big[3], customers, flights_big)
  70.  
  71.     for t in trips_small:
  72.         small_limited += t.get_reservation_id() + str(t.trip_departure) + f'{t.get_in_flight_time()}{t.get_in_flight_time()}{round(t.get_total_trip_time())}'
  73.         for s in t.get_flight_segments():
  74.             small_limited += str(s.seat_availability)
  75.             for element in s._manifest:
  76.                 small_limited += str(element)
  77.  
  78.     for t in trips_big:
  79.         big_limited += t.get_reservation_id() + str(t.trip_departure) + f'{t.get_in_flight_time()}{t.get_in_flight_time()}{round(t.get_total_trip_time())}'
  80.         for s in t.get_flight_segments():
  81.             big_limited += str(s.seat_availability)
  82.             for element in s._manifest:
  83.                 big_limited += str(element)
  84.  
  85.     c_info_limited = ''
  86.     for cid, cust in customers.items():
  87.         c_info_limited += f'{cid}{cust.get_miles()}{cust.get_ff_status()}{round(cust.all_flight_costs)}'
  88.  
  89.     return small_limited, big_limited, c_info_limited
  90.  
  91.  
  92. if __name__ == "__main__":
  93.     small, big, c = deep_fingerprint_trip_id()
  94.     small_limited, big_limited, c_limited = deep_fingerprint_trip_id_limited()
  95.     print("Small MD5 Fingerprint : " + hashlib.md5(
  96.         (small).encode('utf-8')).hexdigest())
  97.     print("big MD5 Fingerprint : " + hashlib.md5(
  98.         (big).encode('utf-8')).hexdigest())
  99.     print("big MD5 Fingerprint : " + hashlib.md5(
  100.         (c).encode('utf-8')).hexdigest())
  101.     print("Small_limited MD5 Fingerprint : " + hashlib.md5(
  102.         (small_limited).encode('utf-8')).hexdigest())
  103.     print("big_limited MD5 Fingerprint : " + hashlib.md5(
  104.         (big_limited).encode('utf-8')).hexdigest())
  105.     print("big MD5 Fingerprint : " + hashlib.md5(
  106.         (c_limited).encode('utf-8')).hexdigest())
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top