예제 #1
0
 def test_config_parsing_halt(self):
     """ Read the half config file and compare values. """
     test_utils.generate_test_config_file_with_only_auth()
     result = gnippy_config.get_config(test_utils.test_config_path)
     self.assertEqual(result['Credentials']['username'], test_utils.test_username)
     self.assertEqual(result['Credentials']['password'], test_utils.test_password)
     self.assertEqual(result['PowerTrack']['url'], None)
예제 #2
0
 def test_config_parsing_halt(self):
     """ Read the half config file and compare values. """
     test_utils.generate_test_config_file_with_only_auth()
     result = gnippy_config.get_config(test_utils.test_config_path)
     self.assertEqual(result['Credentials']['username'],
                      test_utils.test_username)
     self.assertEqual(result['Credentials']['password'],
                      test_utils.test_password)
     self.assertEqual(result['PowerTrack']['url'], None)
예제 #3
0
    def test_constructor_only_url(self):
        """
            Initialize PowerTrackClient with only a url.
            The config file is provided for testability.
        """
        test_utils.generate_test_config_file_with_only_auth()

        client = PowerTrackClient(_dummy_callback, url=test_utils.test_powertrack_url, config_file_path=config_file)
        expected_auth = (test_utils.test_username, test_utils.test_password)
        expected_url = test_utils.test_powertrack_url

        self.assertEqual(expected_auth[0], client.auth[0])
        self.assertEqual(expected_auth[1], client.auth[1])
        self.assertEqual(expected_url, client.url)
예제 #4
0
    def test_constructor_only_url(self):
        """
            Initialize PowerTrackClient with only a url.
            The config file is provided for testability.
        """
        test_utils.generate_test_config_file_with_only_auth()

        client = PowerTrackClient(_dummy_callback,
                                  url=test_utils.test_powertrack_url,
                                  config_file_path=config_file)
        expected_auth = (test_utils.test_username, test_utils.test_password)
        expected_url = test_utils.test_powertrack_url

        self.assertEqual(expected_auth[0], client.auth[0])
        self.assertEqual(expected_auth[1], client.auth[1])
        self.assertEqual(expected_url, client.url)