def testNoBuildTargetFails(self):
        """No build target argument should fail."""
        request = self._GetRequest()

        with self.assertRaises(cros_build_lib.DieSystemExit):
            packages_controller.HasChromePrebuilt(request, self.response,
                                                  self.api_config)
    def testValidateOnly(self):
        """Sanity check that a validate only call does not execute any logic."""
        patch = self.PatchObject(packages_service, 'has_prebuilt')

        request = self._GetRequest(board='betty')
        packages_controller.HasChromePrebuilt(request, self.response,
                                              self.validate_only_config)
        patch.assert_not_called()
  def testMockCall(self):
    """Test that a mock call does not execute logic, returns mocked value."""
    patch = self.PatchObject(packages_service, 'has_prebuilt')

    request = self._GetRequest(board='betty')
    packages_controller.HasChromePrebuilt(request, self.response,
                                          self.mock_call_config)
    patch.assert_not_called()
    self.assertTrue(self.response.has_prebuilt)