compile_build_api_proto: add compiles test.

Add a test that runs the compile script and verifies it produces
*something* as a quick verification it's working.

BUG=b:187795298
TEST=./run_pytest

Change-Id: I262e5c7485b0b5a06b9585112336ae8ffd164402
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/2717371
Tested-by: Alex Klein <saklein@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Alex Klein <saklein@chromium.org>
diff --git a/api/compile_build_api_proto_unittest.py b/api/compile_build_api_proto_unittest.py
index 9420252..a7baf8a 100644
--- a/api/compile_build_api_proto_unittest.py
+++ b/api/compile_build_api_proto_unittest.py
@@ -4,6 +4,8 @@
 
 """compile_build_api_proto tests."""
 
+import os
+
 from chromite.third_party.google import protobuf
 
 from chromite.api import compile_build_api_proto
@@ -24,3 +26,12 @@
   assert compile_build_api_proto.PROTOC_VERSION == protobuf.__version__, (
       'The protobuf library or compile_build_api_proto.PROTOC_VERSION has been '
       'updated, but the other has not. They must be updated together.')
+
+
+def test_compiles(tmpdir):
+  """Test the script successfully compiles something."""
+  assert not os.listdir(tmpdir)
+  compile_build_api_proto.main(['--destination', str(tmpdir)])
+  # It may produce an __init__.py even if nothing else succeeded, so make sure
+  # we have more than just that.
+  assert len(os.listdir(tmpdir)) > 1