Revision 956631b6 test/ganeti.cli_unittest.py
b/test/ganeti.cli_unittest.py | ||
---|---|---|
85 | 85 |
"""Test how we handle splitting an empty string""" |
86 | 86 |
self.failUnlessEqual(cli._SplitKeyVal("option", ""), {}) |
87 | 87 |
|
88 |
|
|
88 | 89 |
class TestIdentKeyVal(unittest.TestCase): |
89 | 90 |
"""Testing case for cli.check_ident_key_val""" |
90 | 91 |
|
... | ... | |
102 | 103 |
self.assertEqual(cikv("-foo"), ("foo", None)) |
103 | 104 |
self.assertRaises(ParameterError, cikv, "-foo:a=c") |
104 | 105 |
|
106 |
# Check negative numbers |
|
107 |
self.assertEqual(cikv("-1:remove"), ("-1", { |
|
108 |
"remove": True, |
|
109 |
})) |
|
110 |
self.assertEqual(cikv("-29447:add,size=4G"), ("-29447", { |
|
111 |
"add": True, |
|
112 |
"size": "4G", |
|
113 |
})) |
|
114 |
for i in ["-:", "-"]: |
|
115 |
self.assertEqual(cikv(i), ("", None)) |
|
116 |
|
|
105 | 117 |
|
106 | 118 |
class TestToStream(unittest.TestCase): |
107 | 119 |
"""Test the ToStream functions""" |
Also available in: Unified diff