tests.integration.test_deploy_model_ssl_off_auth_on   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 20
dl 0
loc 27
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A TestDeployModelSSLOffAuthOn._get_pwd_file() 0 2 1
A TestDeployModelSSLOffAuthOn.test_deploy_ssl_off_auth_on() 0 18 2
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