Total Complexity | 3 |
Total Lines | 27 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | from . import integ_test_base |
||
2 | import base64 |
||
3 | |||
4 | |||
5 | class TestDeployModelSSLOffAuthOn(integ_test_base.IntegTestBase): |
||
6 | def _get_pwd_file(self) -> str: |
||
7 | return "./tests/integration/resources/pwdfile.txt" |
||
8 | |||
9 | def test_deploy_ssl_off_auth_on(self): |
||
10 | self.deploy_models(self._get_username(), self._get_password()) |
||
11 | |||
12 | headers = { |
||
13 | "Content-Type": "application/json", |
||
14 | "TabPy-Client": "Integration test for deploying models with auth", |
||
15 | "Authorization": "Basic " |
||
16 | + base64.b64encode("user1:P@ssw0rd".encode("utf-8")).decode("utf-8"), |
||
17 | } |
||
18 | |||
19 | conn = self._get_connection() |
||
20 | |||
21 | models = ["PCA", "Sentiment%20Analysis", "ttest", "anova"] |
||
22 | for m in models: |
||
23 | conn.request("GET", f"/endpoints/{m}", headers=headers) |
||
24 | m_request = conn.getresponse() |
||
25 | self.assertEqual(200, m_request.status) |
||
26 | m_request.read() |
||
27 |