Esempio n. 1
0
    def test_apikey_setter(self):
        """
        Should set the value of _apikey
        :return:
        """
        expected_key = '123456789abcdefghijkl1234567890a'
        collector = TemperatureFromOpenWeatherDotCom(parent=None,
                                                     parameters={})
        collector.apikey = expected_key

        self.assertEqual(expected_key, collector._apikey)
Esempio n. 2
0
    def test_apikey_setter_invalid_format(self):
        """
        Should raise an error.
        :return:
        """
        from businesslogic.errors import ApiKeyFormatError

        collector = TemperatureFromOpenWeatherDotCom(parent=None,
                                                     parameters={})

        with self.assertRaises(ApiKeyFormatError):
            collector.apikey = '12345'