Beispiel #1
0
    def test_load_location_data_fail(self):
        service = LocastService(self.config, MagicMock())
        service._find_location = find_location = MagicMock()
        service.active = False

        with self.assertRaises(LocationInvalidError):
            service._load_location_data()
            find_location.assert_called()
Beispiel #2
0
    def test_load_location_data(self):
        service = LocastService(self.config, MagicMock())
        service._find_location = find_location = MagicMock()
        service.active = True

        try:
            service._load_location_data()
        except LocationInvalidError as e:
            self.fail(e)

        find_location.assert_called()