Revision 870dc44c test/ganeti.objects_unittest.py
b/test/ganeti.objects_unittest.py | ||
---|---|---|
1 | 1 |
#!/usr/bin/python |
2 | 2 |
# |
3 | 3 |
|
4 |
# Copyright (C) 2006, 2007, 2008 Google Inc. |
|
4 |
# Copyright (C) 2006, 2007, 2008, 2010 Google Inc.
|
|
5 | 5 |
# |
6 | 6 |
# This program is free software; you can redistribute it and/or modify |
7 | 7 |
# it under the terms of the GNU General Public License as published by |
... | ... | |
142 | 142 |
self.fake_cl.FillHV(fake_inst)) |
143 | 143 |
|
144 | 144 |
|
145 |
class TestOS(unittest.TestCase): |
|
146 |
ALL_DATA = [ |
|
147 |
"debootstrap", |
|
148 |
"debootstrap+default", |
|
149 |
"debootstrap++default", |
|
150 |
] |
|
151 |
|
|
152 |
def testSplitNameVariant(self): |
|
153 |
for name in self.ALL_DATA: |
|
154 |
self.assertEqual(len(objects.OS.SplitNameVariant(name)), 2) |
|
155 |
|
|
156 |
def testVariant(self): |
|
157 |
self.assertEqual(objects.OS.GetVariant("debootstrap"), "") |
|
158 |
self.assertEqual(objects.OS.GetVariant("debootstrap+default"), "default") |
|
159 |
|
|
160 |
|
|
145 | 161 |
if __name__ == '__main__': |
146 | 162 |
testutils.GanetiTestProgram() |
Also available in: Unified diff