示例#1
0
def command():
    return InputCommand(name(), _start_cluster, "Starts the specified number of nodes all with the same neighbor")
示例#2
0
def command():
    return InputCommand(
        name(), _start_daisy_chain,
        "Starts the specified number of nodes in a daisy chain")
示例#3
0
def command():
    return InputCommand('help', _prompt_for_usage, "shows usage information for specified command")
    def test_construction(self):
        subject = InputCommand('Fred', run_it, 'the info')

        assert subject.name == 'Fred'
        assert subject.run('scissors') == 'I ran with scissors'
        assert subject.info == 'the info'
    def test_run_for_with_some_input(self):
        subject = InputCommand('Fred', run_it, 'the info')
        result = subject.run_for('he-man')

        assert result == 'I ran with he-man'
    def test_display(self, mocker):
        subject = InputCommand('Fred', run_it, 'the info')
        mock_print = mocker.patch('__builtin__.print')
        subject.display()

        mock_print.assert_called_with("\tFred--------------> the info")