FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora Design Team

 
 
LinkBack Thread Tools
 
Old 08-18-2011, 02:26 PM
Ales Kozumplik
 
Default Moving anaconda.rootPath to constants.ROOT_PATH, Part 3.

Fixes the unit tests.
---
tests/pyanaconda_test/backend_test.py | 9 ++++-----
tests/pyanaconda_test/upgrade_test.py | 6 +++---
2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/tests/pyanaconda_test/backend_test.py b/tests/pyanaconda_test/backend_test.py
index ee888df..89f7faf 100644
--- a/tests/pyanaconda_test/backend_test.py
+++ b/tests/pyanaconda_test/backend_test.py
@@ -38,13 +38,13 @@ class BackendTest(mock.TestCase):
pyanaconda.backend.glob.glob.return_value = [FILE]

anaconda = mock.Mock()
- anaconda.rootPath = '
ab = pyanaconda.backend.AnacondaBackend(anaconda)
ab.copyFirmware(anaconda)
self.assertEqual(pyanaconda.backend.shutil.copyfil e.call_args[0][0], FILE)

def anaconda_backend_do_post_install_test(self):
import pyanaconda.backend
+ from pyanaconda.constants import ROOT_PATH
FILE = 'foo'
A = 'a'
B = 'b'
@@ -62,18 +62,17 @@ class BackendTest(mock.TestCase):
pyanaconda.backend.sys = mock.Mock()

anaconda = mock.Mock()
- anaconda.rootPath = '
anaconda.extraModules = True

ab = pyanaconda.backend.AnacondaBackend(anaconda)
ab.doPostInstall(anaconda)

self.assertEqual(pyanaconda.backend.packages.metho d_calls[0],
- ('recreateInitrd', (A, '), {}))
+ ('recreateInitrd', (A, ROOT_PATH), {}))
self.assertEqual(pyanaconda.backend.shutil.method_ calls[0],
- ('copytree', (FILE, '/root/'), {}))
+ ('copytree', (FILE, ROOT_PATH + '/root/'), {}))
self.assertEqual(pyanaconda.backend.shutil.method_ calls[1],
- ('copytree', (self.DD_EXTRACTED, '/root/DD'), {}))
+ ('copytree', (self.DD_EXTRACTED, ROOT_PATH + '/root/DD'), {}))
self.assertTrue(pyanaconda.backend.storage.writeEs crowPackets.called)

def anaconda_backend_do_install_test(self):
diff --git a/tests/pyanaconda_test/upgrade_test.py b/tests/pyanaconda_test/upgrade_test.py
index a043cc9..0a72417 100644
--- a/tests/pyanaconda_test/upgrade_test.py
+++ b/tests/pyanaconda_test/upgrade_test.py
@@ -203,7 +203,6 @@ class UpgradeTest(mock.TestCase):

anaconda = mock.Mock()
anaconda.upgradeRoot = [']
- anaconda.rootPath = '
pyanaconda.upgrade.upgradeMountFilesystems(anacond a)
self.assertTrue(anaconda.storage.turnOnSwap.called )
self.assertTrue(anaconda.storage.mkDevRoot.called)
@@ -213,6 +212,7 @@ class UpgradeTest(mock.TestCase):
# moving /etc/rpm/platform out of the way
# disabling selinux
import pyanaconda.upgrade
+ from pyanaconda.constants import ROOT_PATH
pyanaconda.upgrade.mountExistingSystem = mock.Mock()
pyanaconda.upgrade.os = mock.Mock()
pyanaconda.upgrade.os.islink.return_value = True
@@ -224,12 +224,12 @@ class UpgradeTest(mock.TestCase):

anaconda = mock.Mock()
anaconda.upgradeRoot = [']
- anaconda.rootPath = '
pyanaconda.upgrade.upgradeMountFilesystems(anacond a)
self.assertTrue(anaconda.storage.turnOnSwap.called )
self.assertTrue(anaconda.storage.mkDevRoot.called)
self.assertEqual(pyanaconda.upgrade.shutil.move.ca ll_args,
- (("/etc/rpm/platform", "/etc/rpm/platform.rpmsave"), {}))
+ ((ROOT_PATH + "/etc/rpm/platform",
+ ROOT_PATH + "/etc/rpm/platform.rpmsave"), {}))
self.assertTrue(pyanaconda.upgrade.selinux.getfile con.called)

def set_steps_test(self):
--
1.7.6

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 09:51 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org