Total Complexity | 2 |
Total Lines | 25 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | from tests import APITestCase, mainnet_client, USERNAME_DEVEL |
||
2 | |||
3 | |||
4 | class TestTradeHubGetUsernameCheck(APITestCase): |
||
5 | |||
6 | def setUp(self) -> None: |
||
7 | self._client = mainnet_client |
||
8 | |||
9 | def test_get_username_check_structure(self): |
||
10 | """ |
||
11 | Check if response match expected dict structure. |
||
12 | :return: |
||
13 | """ |
||
14 | |||
15 | result: bool = self._client.get_username_check(USERNAME_DEVEL) |
||
16 | |||
17 | self.assertIsInstance(result, bool, msg=f"Expected result to be type bool, got {type(result)} instead.") |
||
18 | # TODO need test wallet |
||
19 | self.assertTrue(result, msg=f"Expected username {USERNAME_DEVEL} to be taken.") |
||
20 | |||
21 | result: bool = self._client.get_username_check(USERNAME_DEVEL.upper()) |
||
22 | self.assertIsInstance(result, bool, msg=f"Expected result to be type bool, got {type(result)} instead.") |
||
23 | |||
24 | self.assertFalse(result, msg=f"Expected username {USERNAME_DEVEL.upper()} to be not taken.") |
||
25 |