

def test_named_command_class_should_set_command_name_if_not_defined(self):
    description = 'some description'

    class SomeCommand(NamedCommand):

        def __init__(self, lizy):
            super(SomeCommand, self).__init__(lizy, description)

        def _process_command(self, lizy, args):
            return (None, None)
    subparser_mock = (lambda : 0)
    subparser_mock.add_parser = MagicMock()
    no_name = SomeCommand(Pylease(None, subparser_mock, None))
    eq_(no_name.name, 'some')
    subparser_mock.add_parser.assert_called_once_with('some', help=self)

dataset/ETHPy150Open n9code/pylease/tests/test_command.py CommandTest.test_named_command_class_should_set_command_name_if_not_defined/VarMisuse@120/181 `description`->`self`