TestUsersAPI.test_register()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 4
nop 2
dl 0
loc 6
ccs 4
cts 4
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
"""kytos.cli.commands.users.api.UsersAPI tests."""
2 1
import unittest
3 1
from unittest.mock import patch
4
5 1
from kytos.cli.commands.users.api import UsersAPI
6
7
8 1
class TestUsersAPI(unittest.TestCase):
9
    """Test the class UsersAPI."""
10
11 1
    def setUp(self):
12
        """Execute steps before each tests."""
13 1
        self.users_api = UsersAPI()
14
15 1
    @patch('kytos.utils.users.UsersManager.register')
16 1
    def test_register(self, mock_register):
17
        """Test register method."""
18 1
        self.users_api.register(None)
19
20
        mock_register.assert_called()
21