Test Failed
Pull Request — master (#277)
by Gleyberson
01:26
created

kytos.cli.commands.users.api   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 24
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A UsersAPI.register() 0 5 1
1
"""Translate cli commands to non-cli code."""
2 1
import logging
3
4 1
from kytos.utils.users import UsersManager
5
6 1
LOG = logging.getLogger(__name__)
7
8
9 1
class UsersAPI:
10
    """An API for the command-line interface.
11
12
    Use the config file only for required options. Static methods are called
13
    by the parser and they instantiate an object of this class to fulfill the
14
    request.
15
    """
16
17 1
    user_manager = UsersManager()
18
19 1
    @classmethod
20
    def register(cls, args):  # pylint: disable=unused-argument
21
        """Create a new user and register it on the Napps server."""
22 1
        result = cls.user_manager.register()
23
        print(result)
24