Esempio n. 1
0
class IntersectionPoolTests(unittest.TestCase):
    def setUp(self):
        self.sts_EW = ('A', 'B', 'C', 'D')
        self.sts_NS = ('1', '2', '3')
        self.intersectionpool = GridIntersectionPool(self.sts_NS, self.sts_EW)

    def _random_intersection(self):
        st1 = random.choice(self.sts_NS)
        st2 = random.choice(self.sts_EW)
        return Intersection(st1, st2)

# TODO: add test for getting intersection that does not existZ
    def test_get_one_intersection(self):
        intersection_returned = self.intersectionpool.getat('B', '2')
        intersection_expected = Intersection('B', '2')
        self.assertEqual(intersection_expected, intersection_returned)
Esempio n. 2
0
 def setUp(self):
     self.sts_EW = ('A', 'B', 'C', 'D')
     self.sts_NS = ('1', '2', '3')
     self.intersectionpool = GridIntersectionPool(self.sts_NS, self.sts_EW)