import unittest
import services

class TestDigitransitAPIService(unittest.TestCase):

    def setUp(self):
        self.digitransitAPIService = services.DigitransitAPIService()

    def test_get_stops(self):
        stops = self.digitransitAPIService.get_stops(60.203978, 24.9633573, 160)
        self.assertTrue("stops" in stops)

        all_stops = stops["stops"]
        self.assertEqual(len(all_stops), 1)

        stop = all_stops[0]
        self.assertTrue("stop" in stop)

        stop_data = stop["stop"]
        self.assertTrue("schedule" in stop_data)

        schedule = stop_data["schedule"]
        self.assertNotEqual(len(schedule), 0)


    def test_get_stops_near_coordinates(self):
        self.assertEqual('foo', 'foo')


    def test_get_busses_by_stop_id(self):
        return


if __name__ == '__main__':
    unittest.main()
@@ -24,16 +24,28 @@
 services
+%0Aimport json
 %0A%0Aclass 
@@ -800,14 +800,255 @@
     
-return
+stop = self.digitransitAPIService.get_busses_by_stop_id(%22HSL:1362141%22)%0A        self.assertTrue(%22stop_name%22 in stop)%0A        self.assertEqual(stop%5B%22stop_name%22%5D, 'Viikki')%0A%0A        first = stop%5B%22schedule%22%5D%5B0%5D%0A        self.assertTrue(%22line%22 in first)
 %0A%0A%0Ai

test for get_busses_by_stop_id