Completed
Pull Request — master (#277)
by Gleyberson
01:36
created

tests.unit.commands.test_users_api   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 21
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A TestUsersAPI.setUp() 0 3 1
A TestUsersAPI.test_register() 0 6 1
1
"""kytos.cli.commands.users.api.UsersAPI tests."""
2
import unittest
3
from unittest.mock import patch
4
5
from kytos.cli.commands.users.api import UsersAPI
6
7
8
class TestUsersAPI(unittest.TestCase):
9
    """Test the class UsersAPI."""
10
11
    def setUp(self):
12
        """Execute steps before each tests."""
13
        self.users_api = UsersAPI()
14
15
    @patch('kytos.utils.users.UsersManager.register')
16
    def test_register(self, mock_register):
17
        """Test register method."""
18
        self.users_api.register(None)
19
20
        mock_register.assert_called()
21