| Cole Faust | 43ac21f | 2022-09-19 11:19:52 -0700 | [diff] [blame] | 1 | import sys | 
|  | 2 |  | 
|  | 3 | import unittest | 
|  | 4 | import mylib.subpackage.proto.test_pb2 as test_pb2 | 
|  | 5 | import mylib.subpackage.proto.common_pb2 as common_pb2 | 
|  | 6 |  | 
|  | 7 | print(sys.path) | 
|  | 8 |  | 
|  | 9 | class TestProtoWithPkgPath(unittest.TestCase): | 
|  | 10 |  | 
|  | 11 | def test_main(self): | 
|  | 12 | x = test_pb2.MyMessage(name="foo", | 
|  | 13 | common = common_pb2.MyCommonMessage(common="common")) | 
|  | 14 | self.assertEqual(x.name, "foo") | 
|  | 15 | self.assertEqual(x.common.common, "common") | 
|  | 16 |  | 
|  | 17 | if __name__ == '__main__': | 
|  | 18 | unittest.main() |