Skip to content

Commit

Permalink
Enable kickstart tests for PY3
Browse files Browse the repository at this point in the history
  • Loading branch information
j-mracek authored and kontura committed Oct 15, 2019
1 parent c5ac1b0 commit 9b61d54
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions tests/test_kickstart.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,9 @@

from tests.support import mock

if not support.PY3:
import kickstart
import pykickstart
else:
pykickstart = mock.Mock()
import kickstart
import pykickstart


class _KickstartFileFixture(object):
"""Test fixture containing a kickstart file."""
Expand Down Expand Up @@ -85,7 +83,7 @@ def setUp(self):
base.read_all_repos()
base.basecmd = self._command.aliases[0]

@unittest.skipIf(support.PY3, "pykickstart not available in Py3")

class KickstartCommandTest(_KickstartCommandFixture, unittest.TestCase):
"""Unit tests of kickstart.KickstartCommand."""

Expand Down Expand Up @@ -118,7 +116,7 @@ def test_run_package(self):
support.command_run(self._command, [self._path])
self.assertEqual(self._command.cli.base.installed_pkgs, {self.KICKSTART_PACKAGE})

@unittest.skipIf(support.PY3, "pykickstart not available in Py3")

class KickstartCommandNoCompAGroupTest(_KickstartCommandFixture, unittest.TestCase):
"""Unit tests of kickstart.KickstartCommand with no available group and a group in the file."""

Expand All @@ -128,7 +126,7 @@ def test_run(self):
"""Test whether it fails."""
self.assertRaises(dnf.exceptions.Error, support.command_run, self._command, [self._path])

@unittest.skipIf(support.PY3, "pykickstart not available in Py3")

class KickstartCommandNoCompNoGroupTest(_KickstartCommandFixture, unittest.TestCase):
"""Unit tests of kickstart.KickstartCommand with no available group and no group in the file."""

Expand All @@ -144,7 +142,6 @@ def test_run(self):
self.fail()


@unittest.skipIf(support.PY3, "pykickstart not available in Py3")
class MaskableKickstartParserTest(unittest.TestCase):
"""Unit tests of kickstart.MaskableKickstartParser."""

Expand Down Expand Up @@ -179,7 +176,7 @@ def test_mask_all(self):
else:
self.assertIsInstance(section, pykickstart.sections.NullSection)

@unittest.skipIf(support.PY3, "pykickstart not available in Py3")

class ParseKickstartPackagesTest(_KickstartFileFixture, unittest.TestCase):
"""Unit tests of kickstart.parse_kickstart_packages."""

Expand Down

0 comments on commit 9b61d54

Please sign in to comment.