def test_error_building_project_raises_action_error(self): self.subprocess_maven.build.side_effect = MavenExecutionError( message='Build failed!') action = JavaMavenBuildAction(self.scratch_dir, self.subprocess_maven) with self.assertRaises(ActionFailedError) as raised: action.execute() self.assertEquals(raised.exception.args[0], 'Maven Failed: Build failed!')
def test_calls_maven_build(self): action = JavaMavenBuildAction(self.scratch_dir, self.subprocess_maven) action.execute() self.subprocess_maven.build.assert_called_with(self.scratch_dir)