Freeze upstream versions
[netvirt.git] / resources / tools / odltools / odltools / tests / test_cli.py
1 # Copyright 2018 Red Hat, Inc. and others. All Rights Reserved.
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #     http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15 import unittest
16 from odltools import cli
17 from odltools.csit import robotfiles
18
19
20 class TestOdltools(unittest.TestCase):
21     DATAPATH = "/tmp/output_01_l2.xml.gz"
22     OUTPATH = "/tmp/robotjob"
23
24     def test_parser_empty(self):
25         parser = cli.create_parser()
26         with self.assertRaises(SystemExit) as cm:
27             parser.parse_args([])
28         self.assertEqual(cm.exception.code, 2)
29
30     def test_parser_help(self):
31         parser = cli.create_parser()
32         with self.assertRaises(SystemExit) as cm:
33             parser.parse_args(['-h'])
34         self.assertEqual(cm.exception.code, 0)
35
36     @unittest.skip("skipping")
37     def test_robotfiles_run(self):
38         parser = cli.create_parser()
39         args = parser.parse_args(['csit', self.DATAPATH, self.OUTPATH, '-g'])
40         robotfiles.run(args)
41
42     @unittest.skip("skipping")
43     def test_csit(self):
44         parser = cli.create_parser()
45         args = parser.parse_args(['csit', self.DATAPATH, self.OUTPATH, '-g', '-d'])
46         robotfiles.run(args)
47
48
49 if __name__ == '__main__':
50     unittest.main()