summaryrefslogtreecommitdiff
path: root/python/tests/proto_pkg_path/main.py
blob: c4acddef5638fc5577d8f8b13fb9e1d845b070ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import sys

import unittest
import mylib.subpackage.proto.test_pb2 as test_pb2
import mylib.subpackage.proto.common_pb2 as common_pb2

print(sys.path)

class TestProtoWithPkgPath(unittest.TestCase):

    def test_main(self):
        x = test_pb2.MyMessage(name="foo",
                               common = common_pb2.MyCommonMessage(common="common"))
        self.assertEqual(x.name, "foo")
        self.assertEqual(x.common.common, "common")

if __name__ == '__main__':
    unittest.main()