Example #1
0
 def setUp(self):
     self.statedir = tempfile.mkdtemp(prefix="command.test.statedir.")
     self.statefile = os.path.join(self.statedir, "state")
     self.old_statefile = system_upgrade.State.statefile
     system_upgrade.State.statefile = self.statefile
     self.cli = mock.MagicMock()
     self.command = system_upgrade.SystemUpgradeCommand(cli=self.cli)
Example #2
0
 def setUp(self):
     self.datadir = tempfile.mkdtemp(prefix="system_upgrade_test_datadir-")
     system_upgrade.SystemUpgradeCommand.DATADIR = self.datadir
     self.cli = mock.MagicMock()
     self.cli.base.conf.installroot = "/"
     self.command = system_upgrade.SystemUpgradeCommand(cli=self.cli)
     self.command.base.conf.cachedir = os.path.join(self.datadir, "cache")
     self.command.base.conf.destdir = None
 def setUp(self):
     self.statedir = tempfile.mkdtemp(prefix="command.test.statedir.")
     self.statefile = os.path.join(self.statedir, "state")
     self.old_statefile = system_upgrade.State.statefile
     system_upgrade.State.statefile = self.statefile
     self.cli = mock.MagicMock()
     self.command = system_upgrade.SystemUpgradeCommand(cli=self.cli)
     self.command.base.conf.cachedir = os.path.join(self.statedir, "cache")
     self.command.base.conf.destdir = None
     system_upgrade.DEFAULT_DATADIR = os.path.join(self.statedir,
                                                   'default_datadir')
Example #4
0
 def setUp(self):
     self.datadir = tempfile.mkdtemp(prefix="system_upgrade_test_datadir-")
     self.installroot = tempfile.TemporaryDirectory(prefix="system_upgrade_test_installroot-")
     system_upgrade.SystemUpgradeCommand.DATADIR = self.datadir
     self.cli = mock.MagicMock()
     # the installroot is not strictly necessary for the test, but
     # releasever detection is accessing host system files without it, and
     # this fails on permissions in COPR srpm builds (e.g. from rpm-gitoverlay)
     self.cli.base.conf.installroot = self.installroot.name
     self.command = system_upgrade.SystemUpgradeCommand(cli=self.cli)
     self.command.base.conf.cachedir = os.path.join(self.datadir, "cache")
     self.command.base.conf.destdir = None
 def setUp(self):
     self.cmd = system_upgrade.SystemUpgradeCommand('argparse-testcase')