示例#1
0
文件: test_app.py 项目: ouijan/rabbit
	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)
示例#2
0
文件: test_app.py 项目: ouijan/rabbit
	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)
示例#3
0
文件: test_app.py 项目: ouijan/rabbit
	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)
示例#4
0
文件: test_app.py 项目: ouijan/rabbit
	def test_bootstrap_runs_the_loadLocalConfig(self, config_load):
		app = App()
		localpath = "./" + settings.CONFIG_FILE
		app.loadLocalConfig()
		config_load.assert_called_with(localpath)
示例#5
0
文件: test_app.py 项目: ouijan/rabbit
	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)
示例#6
0
文件: test_app.py 项目: ouijan/rabbit
	def test_bootstrap_runs_the_loadLocalComfig(self, loadCommands):
		app = App()
		app.bootstrap()
		loadCommands.assert_called_with()
示例#7
0
文件: test_app.py 项目: ouijan/rabbit
	def test_bootstrap_runs_the_loadHomeComfig(self, loadHomeConfig):
		app = App()
		app.bootstrap()
		loadHomeConfig.assert_called_with()
示例#8
0
文件: test_app.py 项目: ouijan/rabbit
	def test_it_finds_the_correct_child_group(self):
		app = App()
		command = Command()
		result = app.addCommand(command)
		self.assertTrue(result)
示例#9
0
文件: test_app.py 项目: ouijan/rabbit
	def test_it_validates_command_object_falsy(self):
		app = App()
		command = object
		result = app.addCommand(command)
		self.assertFalse(result)