diff options
author | Michael DeHaan <mdehaan@redhat.com> | 2006-05-05 18:30:44 -0400 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2006-05-05 18:30:44 -0400 |
commit | c1aea64f02ae55d47c18269895717af99839ed0e (patch) | |
tree | be13cc5c96d135cd8a08fd0794507650a55ad35b /tests | |
parent | 3e38df5996d007b4eedc65c4b357502f3e03b604 (diff) | |
download | third_party-cobbler-c1aea64f02ae55d47c18269895717af99839ed0e.tar.gz third_party-cobbler-c1aea64f02ae55d47c18269895717af99839ed0e.tar.xz third_party-cobbler-c1aea64f02ae55d47c18269895717af99839ed0e.zip |
Interim commit during refactoring. Pretty broken as a result of some cleanup but it will get straightened out very soon. The main thing I'm doing here is to remove backreferences from the object tree and make the API simpler, so that folks using the API screw up less. This means making the CLI code simpler as well. The serializer has also been overhauled so it's not as much bolted on, although I have some fixing to do to make it work entirely correctly. Wanted to check all of this in case someone decided to patch something else, making diffing really complex in the interim. I'd recommend not patching anything else to this code as I'm not close to done, really.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/tests.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/tests/tests.py b/tests/tests.py index e5bcb54..6c906bb 100644 --- a/tests/tests.py +++ b/tests/tests.py @@ -15,6 +15,7 @@ sys.path.append('./cobbler') import api import config +import utils FAKE_INITRD="initrd-2.6.15-1.2054_FAKE.img" FAKE_INITRD2="initrd-2.5.16-2.2055_FAKE.img" @@ -27,10 +28,11 @@ FAKE_KICKSTART="http://127.0.0.1/fake.ks" cleanup_dirs = [] class BootTest(unittest.TestCase): - + def setUp(self): # Create temp dir - self.topdir = tempfile.mkdtemp(prefix="_cobbler-",dir="/tmp") + #self.topdir = tempfile.mkdtemp(prefix="_cobbler-",dir="/tmp") + self.topdir = "/tmp" # only for refactoring, fix later print "using dir = %s" % self.topdir self.fk_initrd = os.path.join(self.topdir, FAKE_INITRD) self.fk_initrd2 = os.path.join(self.topdir, FAKE_INITRD2) @@ -39,7 +41,7 @@ class BootTest(unittest.TestCase): self.fk_kernel = os.path.join(self.topdir, FAKE_KERNEL) self.fk_kernel2 = os.path.join(self.topdir, FAKE_KERNEL2) self.fk_kernel3 = os.path.join(self.topdir, FAKE_KERNEL3) - + self.api = api.BootAPI() self.hostname = os.uname()[1] create = [ self.fk_initrd, self.fk_initrd2, self.fk_initrd3, @@ -49,7 +51,8 @@ class BootTest(unittest.TestCase): self.make_basic_config() def tearDown(self): - shutil.rmtree(self.topdir,ignore_errors=True) + # only off during refactoring, fix later + # shutil.rmtree(self.topdir,ignore_errors=True) self.api = None def make_basic_config(self): @@ -76,7 +79,7 @@ class BootTest(unittest.TestCase): class Utilities(BootTest): def _expeq(self, expected, actual): - self.failUnlessEqual(expected, actual, + self.failUnlessEqual(expected, actual, "Expected: %s; actual: %s" % (expected, actual)) def test_kernel_scan(self): |