Пример #1
0
 def test_dictionary_same_planes_not_ok(self):
     test_plane1 = Plane("NYC", "LA")
     env = Environment()
     env.add_plane(test_plane1, "plane1")
     env.add_plane(test_plane1, "plane2")
     env.add_plane(test_plane1, "plane2")
     self.assertFalse(len(env.planes) == 3)
Пример #2
0
 def test_dictionary_ok(self):
     test_plane1 = Plane("NYC", "LA")
     test_plane2 = Plane("NYC", "LA")
     test_plane3 = Plane("NYC", "LA")
     env = Environment()
     env.add_plane(test_plane1, "plane1")
     env.add_plane(test_plane2, "plane2")
     env.add_plane(test_plane3, "plane3")
     self.assertTrue(len(env.planes) == 3)
Пример #3
0
#Make intelligent use of pythons syntactic sugar (overloading, iterators, generators, etc)
#Most of all: CREATE GOOD, RELIABLE, READABLE CODE.
#The goal of this task is for you to SHOW YOUR BEST python programming skills.
#Impress everyone with your skills, show off with your code.
#
#Your program must be runnable with command "python task.py".
#Show some usecases of your library in the code (print some things)
#
#When you are done upload this code to your github repository.
#The whole repository MUST be a fork from https://github.com/mwmajew/kol1_gr2
#Good Luck

from plane import Plane
from environment import Environment
from multiprocessing import Process

if __name__ == "__main__":
    boeing_737 = Plane('Seattle', 'San Diego')
    airbus_A380 = Plane('El Paso', 'Phoenix')
    airbus_A330 = Plane('Detroit', 'Washington')
    env = Environment()
    env.add_plane(boeing_737, 'Boeing 737')
    env.add_plane(airbus_A380, 'Airbus A380')
    env.add_plane(airbus_A330, 'Airbus A330')
    for k in env.planes.keys():
        env.plane_orientation(k)
    print("\n\n")
    for k in env.planes.keys():
        p = Process(target=env.show_info, args=(k, ))
        p.start()
        p.join()