@@ -0,0 +1,2455 @@
+import unittest%0Afrom ..tracks import *%0A%0A%0Aclass TracksTests(unittest.TestCase):%0A    def setUp(self):%0A        trk_array = %5B%0A            Track(direction='Y', x_low=1, x_high=1, y_low=1, y_high=5),%0A            Track(direction='X', x_low=1, x_high=3, y_low=1, y_high=1),%0A            Track(direction='Y', x_low=3, x_high=3, y_low=1, y_high=4),%0A        %5D%0A        cnx_array = %5B(0, 1), (1, 2)%5D%0A        self.trks = Tracks(trk_array, cnx_array)%0A%0A    def test_verify_tracks(self):%0A        self.trks.verify_tracks()%0A%0A    def test_verify_tracks_not_connected(self):%0A        self.trks.tracks.append(%0A            Track(direction='X', x_low=1, x_high=3, y_low=4, y_high=4)%0A        )%0A%0A        with self.assertRaises(AssertionError):%0A            self.trks.verify_tracks()%0A%0A    def test_verify_tracks_directon_error(self):%0A        self.trks.tracks.append(%0A            Track(direction='Y', x_low=1, x_high=1, y_low=5, y_high=6)%0A        )%0A        self.trks.track_connections.append((0, 3))%0A%0A        with self.assertRaises(AssertionError):%0A            self.trks.verify_tracks()%0A%0A    def test_adjacent_simple(self):%0A%0A        self.assertEqual(%0A            self.trks.is_wire_adjacent_to_track(0, (1, 1)), Direction.RIGHT%0A        )%0A        self.assertEqual(%0A            self.trks.is_wire_adjacent_to_track(0, (2, 1)), Direction.LEFT%0A        )%0A        self.assertEqual(%0A            self.trks.is_wire_adjacent_to_track(0, (5, 2)), Direction.NO_SIDE%0A        )%0A%0A        self.assertEqual(%0A            self.trks.is_wire_adjacent_to_track(1, (2, 1)), Direction.TOP%0A        )%0A        self.assertEqual(%0A            self.trks.is_wire_adjacent_to_track(1, (2, 2)), Direction.BOTTOM%0A        )%0A        self.assertEqual(%0A            self.trks.is_wire_adjacent_to_track(1, (5, 2)), Direction.NO_SIDE%0A        )%0A%0A    def test_adjacenet_assert(self):%0A        trk_array = %5B%0A            Track(direction='Y', x_low=1, x_high=1, y_low=1, y_high=5),%0A            Track(direction='X', x_low=1, x_high=3, y_low=1, y_high=1),%0A            Track(direction='foobar', x_low=3, x_high=3, y_low=1, y_high=4),%0A        %5D%0A        cnx_array = %5B(0, 1), (1, 2)%5D%0A        trks = Tracks(trk_array, cnx_array)%0A        with self.assertRaises(AssertionError):%0A            trks.is_wire_adjacent_to_track(2, (3, 1))%0A%0A    def test_get_tracks(self):%0A%0A        dirs = %5Bd for d in self.trks.get_tracks_for_wire_at_coord((1, 1))%5D%0A        self.assertEqual(%0A            sorted(dirs), %5B(0, Direction.RIGHT), (1, Direction.TOP)%5D%0A        )%0A

add tests for tracks.py