[master 4/4] Moving anaconda.rootPath to constants.ROOT_PATH, Part 3.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.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 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(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):
-- 
1.7.6

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


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux