Skip to content

Commit 4067a0e

Browse files
committed
Add test for grm argument parsing in host tests
1 parent 6de6927 commit 4067a0e

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

test/test/host_test_default.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Copyright (c) 2018, Arm Limited and affiliates.
2+
# SPDX-License-Identifier: Apache-2.0
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
import unittest
17+
from mbed_os_tools.test.host_tests_runner.host_test_default import DefaultTestSelector
18+
19+
20+
class HostTestDefaultTestCase(unittest.TestCase):
21+
22+
def test_os_info(self):
23+
expected = {
24+
"grm_module" : "module_name",
25+
"grm_host" : "10.2.123.43",
26+
"grm_port" : "3334",
27+
}
28+
arg = [expected["grm_module"], expected["grm_host"], expected["grm_port"]]
29+
result = DefaultTestSelector._parse_grm(":".join(arg))
30+
self.assertEqual(result, expected)
31+
32+
expected["grm_host"] = "https://10.2.123.43"
33+
arg = [expected["grm_module"], expected["grm_host"], expected["grm_port"]]
34+
result = DefaultTestSelector._parse_grm(":".join(arg))
35+
self.assertEqual(result, expected)
36+
37+
if __name__ == '__main__':
38+
unittest.main()

0 commit comments

Comments
 (0)