summaryrefslogtreecommitdiffstats
path: root/tests/pyanaconda_test
diff options
context:
space:
mode:
authorAles Kozumplik <akozumpl@redhat.com>2011-08-18 13:42:48 +0200
committerAles Kozumplik <akozumpl@redhat.com>2011-08-26 10:26:15 +0200
commit0c662ebeaf4043ff2e2a1f7d09b527f4bf243047 (patch)
tree9073370fe511b8f13087181a82edaa6d6c980bb1 /tests/pyanaconda_test
parent306c0765cb8b44ad732a1dc04a91dee743375aef (diff)
downloadanaconda-0c662ebeaf4043ff2e2a1f7d09b527f4bf243047.tar.gz
anaconda-0c662ebeaf4043ff2e2a1f7d09b527f4bf243047.tar.xz
anaconda-0c662ebeaf4043ff2e2a1f7d09b527f4bf243047.zip
Moving anaconda.rootPath to constants.ROOT_PATH.
Create the constant and remove the old variable. This way we don't have to pass the argument around.
Diffstat (limited to 'tests/pyanaconda_test')
-rw-r--r--tests/pyanaconda_test/backend_test.py9
-rw-r--r--tests/pyanaconda_test/upgrade_test.py6
2 files changed, 7 insertions, 8 deletions
diff --git a/tests/pyanaconda_test/backend_test.py b/tests/pyanaconda_test/backend_test.py
index ee888dfed..89f7faf8f 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.copyfile.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.method_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.writeEscrowPackets.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 a043cc972..0a7241791 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(anaconda)
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(anaconda)
self.assertTrue(anaconda.storage.turnOnSwap.called)
self.assertTrue(anaconda.storage.mkDevRoot.called)
self.assertEqual(pyanaconda.upgrade.shutil.move.call_args,
- (("/etc/rpm/platform", "/etc/rpm/platform.rpmsave"), {}))
+ ((ROOT_PATH + "/etc/rpm/platform",
+ ROOT_PATH + "/etc/rpm/platform.rpmsave"), {}))
self.assertTrue(pyanaconda.upgrade.selinux.getfilecon.called)
def set_steps_test(self):