|
@@ 49-80 (lines=32) @@
|
| 46 |
|
) |
| 47 |
|
self.assertEqual(200, m_response.status_code) |
| 48 |
|
|
| 49 |
|
def test_override_model_ssl_on_auth_on(self): |
| 50 |
|
# Uncomment the following line to preserve |
| 51 |
|
# test case output and other files (config, state, ect.) |
| 52 |
|
# in system temp folder. |
| 53 |
|
# self.set_delete_temp_folder(False) |
| 54 |
|
|
| 55 |
|
self.deploy_models(self._get_username(), self._get_password()) |
| 56 |
|
|
| 57 |
|
# Override models |
| 58 |
|
self.deploy_models(self._get_username(), self._get_password()) |
| 59 |
|
|
| 60 |
|
headers = { |
| 61 |
|
"Content-Type": "application/json", |
| 62 |
|
"TabPy-Client": "Integration test for deploying models with auth", |
| 63 |
|
"Authorization": "Basic " |
| 64 |
|
+ base64.b64encode("user1:P@ssw0rd".encode("utf-8")).decode("utf-8"), |
| 65 |
|
} |
| 66 |
|
|
| 67 |
|
session = requests.Session() |
| 68 |
|
# Do not verify servers' cert to be signed by trusted CA |
| 69 |
|
session.verify = False |
| 70 |
|
# Do not warn about insecure request |
| 71 |
|
requests.packages.urllib3.disable_warnings() |
| 72 |
|
|
| 73 |
|
models = ["PCA", "Sentiment%20Analysis", "ttest", "anova"] |
| 74 |
|
for m in models: |
| 75 |
|
m_response = session.get( |
| 76 |
|
url=f"{self._get_transfer_protocol()}://" |
| 77 |
|
f"localhost:9004/endpoints/{m}", |
| 78 |
|
headers=headers, |
| 79 |
|
) |
| 80 |
|
self.assertEqual(200, m_response.status_code) |
| 81 |
|
|
|
@@ 19-47 (lines=29) @@
|
| 16 |
|
def _get_pwd_file(self) -> str: |
| 17 |
|
return "./tests/integration/resources/pwdfile.txt" |
| 18 |
|
|
| 19 |
|
def test_deploy_ssl_on_auth_on(self): |
| 20 |
|
# Uncomment the following line to preserve |
| 21 |
|
# test case output and other files (config, state, ect.) |
| 22 |
|
# in system temp folder. |
| 23 |
|
# self.set_delete_temp_folder(False) |
| 24 |
|
|
| 25 |
|
self.deploy_models(self._get_username(), self._get_password()) |
| 26 |
|
|
| 27 |
|
headers = { |
| 28 |
|
"Content-Type": "application/json", |
| 29 |
|
"TabPy-Client": "Integration test for deploying models with auth", |
| 30 |
|
"Authorization": "Basic " |
| 31 |
|
+ base64.b64encode("user1:P@ssw0rd".encode("utf-8")).decode("utf-8"), |
| 32 |
|
} |
| 33 |
|
|
| 34 |
|
session = requests.Session() |
| 35 |
|
# Do not verify servers' cert to be signed by trusted CA |
| 36 |
|
session.verify = False |
| 37 |
|
# Do not warn about insecure request |
| 38 |
|
requests.packages.urllib3.disable_warnings() |
| 39 |
|
|
| 40 |
|
models = ["PCA", "Sentiment%20Analysis", "ttest", "anova"] |
| 41 |
|
for m in models: |
| 42 |
|
m_response = session.get( |
| 43 |
|
url=f"{self._get_transfer_protocol()}://" |
| 44 |
|
f"localhost:9004/endpoints/{m}", |
| 45 |
|
headers=headers, |
| 46 |
|
) |
| 47 |
|
self.assertEqual(200, m_response.status_code) |
| 48 |
|
|
| 49 |
|
def test_override_model_ssl_on_auth_on(self): |
| 50 |
|
# Uncomment the following line to preserve |