Add new RHEL7 logvol objects to master
[pykickstart.git] / tests / commands / monitor.py
blob01bf77f7491c8ec5970da15446b9f1200f7b60ec
2 # James Laska <jlaska@redhat.com>
4 # Copyright 2009 Red Hat, Inc.
6 # This copyrighted material is made available to anyone wishing to use, modify,
7 # copy, or redistribute it subject to the terms and conditions of the GNU
8 # General Public License v.2. This program is distributed in the hope that it
9 # will be useful, but WITHOUT ANY WARRANTY expressed or implied, including the
10 # implied warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11 # See the GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License along with
14 # this program; if not, write to the Free Software Foundation, Inc., 51
15 # Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Any Red Hat
16 # trademarks that are incorporated in the source code or documentation are not
17 # subject to the GNU General Public License and may only be used or replicated
18 # with the express permission of Red Hat, Inc.
20 from tests.baseclass import *
21 from pykickstart.base import *
22 from pykickstart.errors import *
23 from pykickstart.commands.monitor import *
25 class FC3_TestCase(CommandTest):
26 command = "monitor"
28 def runTest(self):
29 # pass
30 self.assert_parse("monitor", "")
31 self.assert_parse("monitor --hsync=HSYNC", "monitor --hsync=HSYNC\n")
32 self.assert_parse("monitor --vsync=VSYNC", "monitor --vsync=VSYNC\n")
33 self.assert_parse("monitor --monitor=MONITOR", "monitor --monitor=\"MONITOR\"\n")
34 self.assert_parse("monitor --hsync=HSYNC --monitor=MONITOR",
35 "monitor --hsync=HSYNC --monitor=\"MONITOR\"\n")
36 self.assert_parse("monitor --monitor=MONITOR --vsync=VSYNC",
37 "monitor --monitor=\"MONITOR\" --vsync=VSYNC\n")
38 self.assert_parse("monitor --hsync=HSYNC --monitor=MONITOR --vsync=VSYNC",
39 "monitor --hsync=HSYNC --monitor=\"MONITOR\" --vsync=VSYNC\n")
41 self.assert_parse_error("monitor BOGUS", KickstartValueError)
42 self.assert_parse_error("monitor --monitor=SOMETHING GREAT", KickstartValueError)
44 if "--noprobe" not in self.optionList:
45 self.assert_parse_error("monitor --noprobe", KickstartParseError)
47 class FC6_TestCase(FC3_TestCase):
48 def runTest(self):
49 FC3_TestCase.runTest(self)
51 # pass
52 self.assert_parse("monitor --noprobe", "monitor --noprobe\n")
53 # fail
54 self.assert_parse_error("monitor --noprobe 1", KickstartValueError)
56 class F10_TestCase(FC6_TestCase):
57 def runTest(self):
58 # make sure we've been deprecated
59 parser = self.getParser("monitor")
60 self.assertEqual(issubclass(parser.__class__, DeprecatedCommand), True)
62 if __name__ == "__main__":
63 unittest.main()