-
Notifications
You must be signed in to change notification settings - Fork 457
/
test.py
18 lines (12 loc) · 670 Bytes
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env python3
print('testing protobuf (cpp)...')
import google.protobuf
print('protobuf version: ' + str(google.protobuf.__version__))
# verify implementation is cpp
from google.protobuf.internal import api_implementation
protobuf_implementation = str(api_implementation.Type())
print(f'protobuf default API implementation: {str(api_implementation._default_implementation_type)}')
print(f'protobuf active API implementation: {protobuf_implementation}')
if protobuf_implementation != "cpp":
raise ValueError(f'expected protobuf to have cpp implementation, but instead it has {protobuf_implementation} implementation')
print('protobuf (cpp) OK\n')