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()
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()