Total Complexity | 1 |
Total Lines | 23 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | import integ_test_base |
||
2 | import subprocess |
||
3 | from pathlib import Path |
||
4 | |||
5 | |||
6 | class TestDeployAndEvaluateModel(integ_test_base.IntegTestBase): |
||
7 | def test_deploy_and_evaluate_model(self): |
||
8 | path = str(Path('models', 'setup.py')) |
||
9 | subprocess.call([self.py, path, self._get_config_file_name()]) |
||
10 | |||
11 | payload = ( |
||
12 | '''{ |
||
13 | "data": { "_arg1": ["happy", "sad", "neutral"] }, |
||
14 | "script": |
||
15 | "return tabpy.query('Sentiment Analysis',_arg1)['response']" |
||
16 | }''') |
||
17 | |||
18 | conn = self._get_connection() |
||
19 | conn.request("POST", "/evaluate", payload) |
||
20 | SentimentAnalysis_eval = conn.getresponse() |
||
21 | self.assertEqual(200, SentimentAnalysis_eval.status) |
||
22 | SentimentAnalysis_eval.read() |
||
23 |