def test_setup_symbolized_build(self):
        """Test setup_symbolized_build."""
        request = untrusted_runner_pb2.SetupSymbolizedBuildRequest(
            base_build_dir='/base',
            revision=1337,
            release_build_url='https://build/url-release.zip',
            debug_build_url='https://build/url-debug.zip')

        self.mock.symbolized_build_setup.side_effect = _mock_symbolized_build_setup
        response = build_setup.setup_symbolized_build(request)
        self.assertTrue(response.result)
        self.assertEqual(response.app_path, '/release/bin/app')
        self.assertEqual(response.app_path_debug, '/debug/bin/app')
        self.assertEqual(response.app_dir, '/debug/bin')
        self.assertEqual(response.build_dir, '/debug')
        self.assertEqual(response.build_url, 'https://build/url-release.zip')

        self.mock.symbolized_build_setup.side_effect = _failed_setup
        response = build_setup.setup_symbolized_build(request)
        self.assertFalse(response.result)
        self.assertFalse(response.HasField('app_path'))
        self.assertFalse(response.HasField('app_path_debug'))
        self.assertFalse(response.HasField('app_dir'))
        self.assertFalse(response.HasField('build_dir'))
        self.assertFalse(response.HasField('build_url'))
Example #2
0
  def setup(self):
    request = untrusted_runner_pb2.SetupSymbolizedBuildRequest(
        base_build_dir=self.base_build_dir,
        revision=self.revision,
        release_build_url=self.release_build_url,
        debug_build_url=self.debug_build_url)

    return _handle_response(self, host.stub().SetupSymbolizedBuild(request))