Build API: Prevent entering the chroot for mock/validate calls.

The interface for mock/validate calls should allow them to all be
executed without setting up the chroot. In practice, this currently
breaks at least the dependency service, but since nothing is relying
on it, that's fine for now.

I am planning on exploring adding builders that use the mock and validate
functionality, this will be a prereq for that.

BUG=None
TEST=run_pytest

Change-Id: I21aa38a2bbc2ff2793fc7d7ba0ab8ae0236dbcb6
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/2589369
Tested-by: Alex Klein <saklein@chromium.org>
Auto-Submit: Alex Klein <saklein@chromium.org>
Reviewed-by: Michael Mortensen <mmortensen@google.com>
Commit-Queue: Michael Mortensen <mmortensen@google.com>
diff --git a/api/api_config.py b/api/api_config.py
index a26f5fa..17801c3 100644
--- a/api/api_config.py
+++ b/api/api_config.py
@@ -90,6 +90,12 @@
   def mock_invalid(self):
     return self._call_type == self.CALL_TYPE_MOCK_INVALID
 
+  @property
+  def run_endpoint(self) -> bool:
+    """Run the endpoint when none of the special calls are invoked."""
+    return (not self.validate_only and not self.mock_call and
+            not self.mock_error and not self.mock_invalid)
+
   def get_proto(self, for_inside_execution=True):
     """Get the config as a proto.