コード例 #1
0
ファイル: test_config.py プロジェクト: Evzdrop/gnippy
 def test_config_parsing_full(self):
     """ Read the test config and compare values. """
     test_utils.generate_test_config_file()
     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'], test_utils.test_powertrack_url)
コード例 #2
0
ファイル: test_config.py プロジェクト: Evzdrop/gnippy
 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
ファイル: test_config.py プロジェクト: thongdong7/gnippy
 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)
コード例 #4
0
ファイル: test_config.py プロジェクト: thongdong7/gnippy
 def test_config_parsing_full(self):
     """ Read the test config and compare values. """
     test_utils.generate_test_config_file()
     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'],
                      test_utils.test_powertrack_url)
コード例 #5
0
ファイル: powertrackclient.py プロジェクト: abh1nav/gnippy
    def load_config_from_file(self, url, auth, config_file_path):
        """ Attempt to load the config from a file. """
        conf = config.get_config(config_file_path=config_file_path)

        if url is None:
            conf_url = conf['PowerTrack']['url']
            if conf_url:
                self.url = conf['PowerTrack']['url']
        else:
            self.url = url

        if auth is None:
            conf_uname = conf['Credentials']['username']
            conf_pwd = conf['Credentials']['password']
            self.auth = (conf_uname, conf_pwd)
        else:
            self.auth = auth
コード例 #6
0
ファイル: powertrackclient.py プロジェクト: knowsis/gnippy
    def load_config_from_file(self, url, auth, config_file_path):
        """ Attempt to load the config from a file. """
        conf = config.get_config(config_file_path=config_file_path)

        if url is None:
            conf_url = conf["PowerTrack"]["url"]
            if conf_url:
                self.url = conf["PowerTrack"]["url"]
        else:
            self.url = url

        if auth is None:
            conf_uname = conf["Credentials"]["username"]
            conf_pwd = conf["Credentials"]["password"]
            self.auth = (conf_uname, conf_pwd)
        else:
            self.auth = auth
コード例 #7
0
    def load_config_from_file(self, url, auth, config_file_path):
        """ Attempt to load the config from a file. """
        conf = config.get_config(config_file_path=config_file_path)

        if url is None:
            conf_url = conf['PowerTrack']['url']
            if conf_url:
                self.url = conf['PowerTrack']['url']
        else:
            self.url = url

        if auth is None:
            conf_uname = conf['Credentials']['username']
            conf_pwd = conf['Credentials']['password']
            self.auth = (conf_uname, conf_pwd)
        else:
            self.auth = auth