| Total Complexity | 5 |
| Total Lines | 31 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | from . import integ_test_base |
||
| 2 | import requests |
||
| 3 | |||
| 4 | |||
| 5 | class TestDeployModelSSLOnAuthOff(integ_test_base.IntegTestBase): |
||
| 6 | def _get_transfer_protocol(self) -> str: |
||
| 7 | return "https" |
||
| 8 | |||
| 9 | def _get_certificate_file_name(self) -> str: |
||
| 10 | return "./tests/integration/resources/2019_04_24_to_3018_08_25.crt" |
||
| 11 | |||
| 12 | def _get_key_file_name(self) -> str: |
||
| 13 | return "./tests/integration/resources/2019_04_24_to_3018_08_25.key" |
||
| 14 | |||
| 15 | def test_deploy_ssl_on_auth_off(self): |
||
| 16 | self.deploy_models(self._get_username(), self._get_password()) |
||
| 17 | |||
| 18 | session = requests.Session() |
||
| 19 | # Do not verify servers' cert to be signed by trusted CA |
||
| 20 | session.verify = False |
||
| 21 | # Do not warn about insecure request |
||
| 22 | requests.packages.urllib3.disable_warnings() |
||
| 23 | |||
| 24 | models = ["PCA", "Sentiment%20Analysis", "ttest", "anova"] |
||
| 25 | for m in models: |
||
| 26 | m_response = session.get( |
||
| 27 | url=f"{self._get_transfer_protocol()}://" |
||
| 28 | f"localhost:9004/endpoints/{m}" |
||
| 29 | ) |
||
| 30 | self.assertEqual(200, m_response.status_code) |
||
| 31 |