def test_it_calls_addCommand_for_each_command(self, add_command, create_command, config_get): app = App() config_get.return_value = [1] create_command.return_value = 'test'; result = app.loadCommands() add_command.assert_called_with('test') self.assertTrue(result)
def test_it_creates_a_new_command_with_given_data(self, create_command, config_get): app = App() config_get.return_value = [1] result = app.loadCommands() create_command.assert_called_with(1) self.assertTrue(result)
def test_it_doesnt_call_addCommand_when_no_commands_are_present(self, config_get): app = App() config_get.return_value = None result = app.loadCommands() self.assertFalse(result)
def test_bootstrap_runs_the_loadLocalConfig(self, config_load): app = App() localpath = "./" + settings.CONFIG_FILE app.loadLocalConfig() config_load.assert_called_with(localpath)
def test_bootstrap_runs_the_loadLocalConfig(self, expanduser_mock, config_load): app = App() expanduser_mock.return_value = 'test' homepath = "test/" + settings.CONFIG_FILE app.loadHomeConfig() config_load.assert_called_with(homepath)
def test_bootstrap_runs_the_loadLocalComfig(self, loadCommands): app = App() app.bootstrap() loadCommands.assert_called_with()
def test_bootstrap_runs_the_loadHomeComfig(self, loadHomeConfig): app = App() app.bootstrap() loadHomeConfig.assert_called_with()
def test_it_finds_the_correct_child_group(self): app = App() command = Command() result = app.addCommand(command) self.assertTrue(result)
def test_it_validates_command_object_falsy(self): app = App() command = object result = app.addCommand(command) self.assertFalse(result)