Beispiel #1
0
 def test_hmac_config_file(self):
     _file = "config_hmac.ini"
     config = config_from_file(os.path.join(TEST_ROOT, _file))
     auth = auth_from_config(config)
     self.assertEqual(type(auth), HMACAuth)
     client = client_from_config_file(os.path.join(TEST_ROOT, _file))
     self.assertEqual(type(client.http_client.auth_strategy), HMACAuth)
Beispiel #2
0
 def test_hmac_config_file(self):
     _file = "config_hmac.ini"
     config = config_from_file(os.path.join(TEST_ROOT, _file))
     auth = auth_from_config(config)
     self.assertEqual(type(auth), HMACAuth)
     client = client_from_config_file(os.path.join(TEST_ROOT, _file))
     self.assertEqual(type(client.http_client.auth_strategy), HMACAuth)
Beispiel #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)
Beispiel #4
0
    def test_srs_no_config(self):
        config = srs_config_from_file(path=os.path.join(TEST_ROOT, "config_blank.ini"))
        auth = auth_from_config(config)
        self.assertEqual(config["url"], _default_url())
        self.assertEqual(auth, None)

        client = srs_client_from_config_file(path=os.path.join(TEST_ROOT, "config_blank.ini"))
        self.assertEqual(client.http_client.auth_strategy, None)
Beispiel #5
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"))
Beispiel #6
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"))
Beispiel #7
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)
Beispiel #8
0
    def test_srs_no_config(self):
        config = srs_config_from_file(
            path=os.path.join(TEST_ROOT, "config_blank.ini"))
        auth = auth_from_config(config)
        self.assertEqual(config["url"], _default_url())
        self.assertEqual(auth, None)

        client = srs_client_from_config_file(
            path=os.path.join(TEST_ROOT, "config_blank.ini"))
        self.assertEqual(client.http_client.auth_strategy, None)
Beispiel #9
0
 def test_srs_config_file_none(self):
     config = config_from_file(os.path.join(TEST_ROOT, "config_srs.ini"), "dev")
     print(config)
     auth = auth_from_config(config)
     self.assertEqual(auth, None)
Beispiel #10
0
 def test_srs_config_file(self):
     config = config_from_file(os.path.join(TEST_ROOT, "config_srs.ini"))
     auth = auth_from_config(config)
     self.assertEqual(type(auth), HMACAuthSRS)
Beispiel #11
0
 def test_srs_config_file_none(self):
     config = config_from_file(os.path.join(TEST_ROOT, "config_srs.ini"),
                               "dev")
     print(config)
     auth = auth_from_config(config)
     self.assertEqual(auth, None)
Beispiel #12
0
 def test_srs_config_file(self):
     config = config_from_file(os.path.join(TEST_ROOT, "config_srs.ini"))
     auth = auth_from_config(config)
     self.assertEqual(type(auth), HMACAuthSRS)