Completed
Push — main ( 5e6d02...339f4c )
by
unknown
15s queued 12s
created

tests.test_tradehub_get_username_check   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 12
dl 0
loc 25
rs 10
c 0
b 0
f 0
wmc 2
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