From 895e102958eec82c477b49c5e2d5b092a29cbb34 Mon Sep 17 00:00:00 2001 From: Xiangquan Xiao Date: Wed, 6 Nov 2019 18:35:13 -0800 Subject: [PATCH] Cyber: Implement py3_init test script. --- cyber/python/test/test_init_py3.py | 44 ++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100755 cyber/python/test/test_init_py3.py diff --git a/cyber/python/test/test_init_py3.py b/cyber/python/test/test_init_py3.py new file mode 100755 index 00000000000..d9ad7b7d604 --- /dev/null +++ b/cyber/python/test/test_init_py3.py @@ -0,0 +1,44 @@ +#!/usr/bin/env python3 + +# **************************************************************************** +# Copyright 2019 The Apollo Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# **************************************************************************** +# -*- coding: utf-8 -*- +"""Module for test init.""" + +import sys +import unittest + +sys.path.append("../") +from cyber_py import cyber_py3 as cyber + + +class TestInit(unittest.TestCase): + + """ + Class for init unit test. + """ + + def test_init(self): + """ + Test cyber. + """ + self.assertTrue(cyber.init()) + self.assertTrue(cyber.ok()) + cyber.shutdown() + self.assertTrue(cyber.is_shutdown()) + +if __name__ == '__main__': + unittest.main()