aboutsummaryrefslogtreecommitdiffhomepage
path: root/python/google/protobuf/internal
diff options
context:
space:
mode:
authorGravatar Bo Yang <teboring@google.com>2015-07-06 16:07:57 -0700
committerGravatar Bo Yang <teboring@google.com>2015-07-09 12:39:52 -0700
commit9f563bd0d8863da35524f7d0a6f87abb2ec228a3 (patch)
tree8475f940f97422dcba951238e93b16f223d94f0b /python/google/protobuf/internal
parent5a020d41a55d2ad44bf0e84c74ba91758ef5d016 (diff)
Internal local modifications.
Diffstat (limited to 'python/google/protobuf/internal')
-rwxr-xr-xpython/google/protobuf/internal/test_util.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/python/google/protobuf/internal/test_util.py b/python/google/protobuf/internal/test_util.py
index 0cbdbad9..fec65382 100755
--- a/python/google/protobuf/internal/test_util.py
+++ b/python/google/protobuf/internal/test_util.py
@@ -602,6 +602,13 @@ def GoldenFile(filename):
return open(full_path, 'rb')
path = os.path.join(path, '..')
+ # Search internally.
+ path = '.'
+ full_path = os.path.join(path, 'third_party/py/google/protobuf/testdata', filename)
+ if os.path.exists(full_path):
+ # Found it. Load the golden file from the testdata directory.
+ return open(full_path, 'rb')
+
raise RuntimeError(
'Could not find golden files. This test must be run from within the '
'protobuf source package so that it can read test data files from the '