Esempio n. 1
0
    def setUp(self):
        self.high_priority_api_key = "high-priority-api-key"
        self.high_priority_cloud = "high-priority-cloud"

        self.low_priority_api_key = "low-priority-api-key"
        self.low_priority_cloud = "low-priority-cloud"

        high_priority_config = """
        [auth]
        api_key = %s

        [private_cloud]
        cloud = %s
        """ % (self.high_priority_api_key, self.high_priority_cloud)

        low_priority_config = """
        [auth]
        username = %s

        [private_cloud]
        cloud = %s
        """ % (self.low_priority_api_key, self.low_priority_cloud)

        high_priority_config_file = StringIO(
            textwrap.dedent(high_priority_config))
        low_priority_config_file = StringIO(
            textwrap.dedent(low_priority_config))

        os.environ = {}
        self.settings = Settings(
            files=[low_priority_config_file, high_priority_config_file])
Esempio n. 2
0
    def setUp(self):
        self.api_key = "test"
        self.cloud = "localhost"
        config = """
        [auth]
        api_key = %s

        [private_cloud]
        cloud = %s
        """ % (self.api_key, self.cloud)

        config_file = StringIO(textwrap.dedent(config))
        self.settings = Settings(files=[config_file])
        os.environ = {}
Esempio n. 3
0
    def setUp(self):
        self.file_api_key = "file-api-key"
        self.file_cloud = "file-cloud"

        self.env_api_key = "env-api-key"
        self.env_cloud = "env-cloud"
        config = """
        [auth]
        api_key = %s

        [private_cloud]
        cloud = %s
        """ % (self.file_api_key, self.file_cloud)

        config_file = StringIO(textwrap.dedent(config))
        os.environ = {
            'INDICO_CLOUD': self.env_cloud,
            'INDICO_API_KEY': self.env_api_key
        }
        self.settings = Settings(files=[config_file])