Esempio n. 1
0
	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)
Esempio n. 2
0
	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)
Esempio n. 3
0
	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)
Esempio n. 4
0
	def test_bootstrap_runs_the_loadLocalConfig(self, config_load):
		app = App()
		localpath = "./" + settings.CONFIG_FILE
		app.loadLocalConfig()
		config_load.assert_called_with(localpath)
Esempio n. 5
0
	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)
Esempio n. 6
0
	def test_bootstrap_runs_the_loadLocalComfig(self, loadCommands):
		app = App()
		app.bootstrap()
		loadCommands.assert_called_with()
Esempio n. 7
0
	def test_bootstrap_runs_the_loadHomeComfig(self, loadHomeConfig):
		app = App()
		app.bootstrap()
		loadHomeConfig.assert_called_with()
Esempio n. 8
0
	def test_it_finds_the_correct_child_group(self):
		app = App()
		command = Command()
		result = app.addCommand(command)
		self.assertTrue(result)
Esempio n. 9
0
	def test_it_validates_command_object_falsy(self):
		app = App()
		command = object
		result = app.addCommand(command)
		self.assertFalse(result)