Пример #1
0
    def load_storage(self):
        super(ServiceHandlerTestClient, self).load_storage()

        self.add_license_keys_store(filepath=os.path.dirname(__file__) + os.sep + "testdata" + os.sep + "license.keys")

        self.add_services_store(dirs=[MetOfficeService.get_default_conf_file(),
                                      WikipediaService.get_default_conf_file(),
                                      AccuWeatherService.get_default_conf_file(),
                                      CocktailDBService.get_default_conf_file(),
                                      DarkSkyService.get_default_conf_file(),
                                      DuckDuckGoService.get_default_conf_file(),
                                      GenericService.get_default_conf_file(),
                                      GeoNamesService.get_default_conf_file(),
                                      GetGuidelinesService.get_default_conf_file(),
                                      GNewsService.get_default_conf_file(),
                                      GoodReadsService.get_default_conf_file(),
                                      GoogleGeoCodeService.get_default_conf_file(),
                                      GoogleDistanceService.get_default_conf_file(),
                                      GoogleDirectionsService.get_default_conf_file(),
                                      NewsAPIService.get_default_conf_file(),
                                      OMDBService.get_default_conf_file(),
                                      PandoraService.get_default_conf_file(),
                                      ProgramyService.get_default_conf_file(),
                                      WolframAlphaService.get_default_conf_file(),
                                      WorldTradingDataStocksService.get_default_conf_file()
                                      ])
        self.add_pattern_nodes_store()
        self.add_template_nodes_store()
Пример #2
0
    def test_conditions_location_aiml(self):
        client = AccuWeatherServiceTestClient()
        conf_file = AccuWeatherService.get_default_conf_file()

        response = self._do_handler_load(client, conf_file, "accuweather", "ACCUWEATHER CONDITIONS LOCATION KINGHORN")
        self.assertIsNotNone(response)
        self.assertEqual("It is currently -0.7 C and Cloudy.", response)
Пример #3
0
    def test_weather_location_aiml(self):
        client = AccuWeatherServiceTestClient()
        conf_file = AccuWeatherService.get_default_conf_file()

        response = self._do_handler_load(client, conf_file, "accuweather", "ACCUWEATHER WEATHER LOCATION KINGHORN")
        self.assertIsNotNone(response)
        self.assertTrue(response.startswith("It is currently"))
Пример #4
0
    def test_handler_load_textsearch(self):
        client = AccuWeatherServiceTestClient()
        conf_file = AccuWeatherService.get_default_conf_file()

        response = self._do_handler_load(client, conf_file, "accuweather", "ACCUWEATHER TEXTSEARCH LOCATION KINGHORN")
        self.assertIsNotNone(response)
        self.assertEqual("ACCUWEATHER RESULT KEY 3385695.", response)