Ejemplo n.º 1
0
    def test_default_config_with_mode(self):
        config = default_config(mode="prod")
        auth = auth_from_config(config)
        self.assertEqual(config["url"], default_url(mode="prod"))
        self.assertEqual(auth, None)

        client = client_from_config(config)
        self.assertEqual(client.http_client.auth_strategy, None)
        self.assertEqual(client.url, default_url(mode="prod"))
Ejemplo n.º 2
0
    def test_default_config_with_mode(self):
        config = default_config(mode="prod")
        auth = auth_from_config(config)
        self.assertEqual(config["url"], default_url(mode="prod"))
        self.assertEqual(auth, None)

        client = client_from_config(config)
        self.assertEqual(client.http_client.auth_strategy, None)
        self.assertEqual(client.url, default_url(mode="prod"))
Ejemplo n.º 3
0
    def test_no_config_with_mode(self):
        config = config_from_file(os.path.join(TEST_ROOT, "config_blank.ini"), mode="prod")
        auth = auth_from_config(config)
        self.assertEqual(config["url"], default_url(mode="prod"))
        self.assertEqual(auth, None)

        client = client_from_config_file(path=os.path.join(TEST_ROOT, "config_blank.ini"))
        self.assertEqual(client.http_client.auth_strategy, None)
Ejemplo n.º 4
0
    def test_no_config_with_mode(self):
        config = config_from_file(os.path.join(TEST_ROOT, "config_blank.ini"),
                                  mode="prod")
        auth = auth_from_config(config)
        self.assertEqual(config["url"], default_url(mode="prod"))
        self.assertEqual(auth, None)

        client = client_from_config_file(
            path=os.path.join(TEST_ROOT, "config_blank.ini"))
        self.assertEqual(client.http_client.auth_strategy, None)