@@ 37-48 (lines=12) @@ | ||
34 | self.assertIsInstance( trains[0], TubeTrain ) |
|
35 | self.assertEqual( len(trains), 110 ) |
|
36 | ||
37 | def test_getAllTrainsForLine(self): |
|
38 | with my_vcr.use_cassette('User-All-Line-North.json'): |
|
39 | trains = self.tube.getAllTrainsForLine("N") |
|
40 | self.assertIsInstance( trains, list ) |
|
41 | self.assertIsInstance( trains[0], TubeTrain ) |
|
42 | self.assertEqual( len(trains), 152 ) |
|
43 | with my_vcr.use_cassette('User-All-Line-North.json'): |
|
44 | northern = self.tube.map.get(linecode="N") |
|
45 | trains = self.tube.getAllTrainsForLine(northern) |
|
46 | self.assertIsInstance( trains, list ) |
|
47 | self.assertIsInstance( trains[0], TubeTrain ) |
|
48 | self.assertEqual( len(trains), 152 ) |
|
49 | ||
@@ 24-35 (lines=12) @@ | ||
21 | def setUp(self): |
|
22 | self.tube = Tube() |
|
23 | ||
24 | def test_getAllTrainsForStation(self): |
|
25 | with my_vcr.use_cassette('User-All-Station-KXX.json'): |
|
26 | trains = self.tube.getAllTrainsForStation("KXX") |
|
27 | self.assertIsInstance( trains, list ) |
|
28 | self.assertIsInstance( trains[0], TubeTrain ) |
|
29 | self.assertEqual( len(trains), 110 ) |
|
30 | with my_vcr.use_cassette('User-All-Station-KXX.json'): |
|
31 | kxx = self.tube.map.get(stationcode="KXX") |
|
32 | trains = self.tube.getAllTrainsForStation(kxx) |
|
33 | self.assertIsInstance( trains, list ) |
|
34 | self.assertIsInstance( trains[0], TubeTrain ) |
|
35 | self.assertEqual( len(trains), 110 ) |
|
36 | ||
37 | def test_getAllTrainsForLine(self): |
|
38 | with my_vcr.use_cassette('User-All-Line-North.json'): |