| Total Complexity | 2 |
| Total Lines | 29 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | from unittest import TestCase |
||
| 2 | |||
| 3 | from flask.wrappers import Response |
||
| 4 | |||
| 5 | from app import create_app |
||
| 6 | from config.app_config import LocalLevelConfig |
||
| 7 | from config.db_config import LocalDBConfig |
||
| 8 | |||
| 9 | |||
| 10 | class BaseTestCase(TestCase): |
||
| 11 | def setUp(self): |
||
| 12 | self.app = create_app(LocalLevelConfig, LocalDBConfig) |
||
| 13 | self.client = self.app.test_client() |
||
| 14 | |||
| 15 | self.method = 'GET' |
||
| 16 | self.path = None |
||
| 17 | self.path_parameters = dict() |
||
| 18 | |||
| 19 | self.headers = dict() |
||
| 20 | self.json = dict() |
||
| 21 | self.query_string = dict() |
||
| 22 | |||
| 23 | def request(self) -> Response: |
||
| 24 | return self.client.open( |
||
| 25 | method=self.method, |
||
| 26 | path=self.path.format(**self.path_parameters), |
||
| 27 | json=self.json, |
||
| 28 | query_string=self.query_string |
||
| 29 | ) |
||
| 30 |