Skip to content

Commit

Permalink
Merge remote-tracking branch 'clebergnu/selftests_reorg_v2'
Browse files Browse the repository at this point in the history
Signed-off-by: Cleber Rosa <[email protected]>
  • Loading branch information
clebergnu committed Mar 31, 2021
2 parents 933c920 + e07373d commit 78e6c68
Show file tree
Hide file tree
Showing 50 changed files with 38 additions and 37 deletions.
2 changes: 1 addition & 1 deletion examples/jobs/nrunner.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
'nrunner.status_server_listen': status_server,
'nrunner.status_server_uri': status_server,
'run.references': [
'selftests/unit/test_resolver.py',
'selftests/unit/plugin/test_resolver.py',
'selftests/functional/test_argument_parsing.py',
'/bin/true',
],
Expand Down
6 changes: 3 additions & 3 deletions selftests/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,9 +498,9 @@ def create_suites(args):
# Run all static checks, unit and functional tests
# ========================================================================
config_check = {
'run.references': (glob.glob('selftests/jobs/*') +
glob.glob('selftests/unit/*.py') +
glob.glob('selftests/functional/*.py')),
'run.references': ['selftests/jobs/',
'selftests/unit/',
'selftests/functional/'],
'run.test_runner': 'nrunner',
'run.ignore_missing_references': True
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
from avocado.core import exit_codes
from avocado.utils import process

from .. import (AVOCADO, TestCaseTmpDir, get_temporary_config,
skipUnlessPathExists)
from ... import (AVOCADO, TestCaseTmpDir, get_temporary_config,
skipUnlessPathExists)

TEST_TEMPLATE = r"""
from avocado import Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from avocado.core import exit_codes
from avocado.utils import process, script

from .. import AVOCADO, BASEDIR, TestCaseTmpDir
from ... import AVOCADO, BASEDIR, TestCaseTmpDir


class DiffTests(TestCaseTmpDir):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from avocado.core import exit_codes
from avocado.utils import process, script

from .. import AVOCADO, TestCaseTmpDir
from ... import AVOCADO, TestCaseTmpDir

SCRIPT_PRE_TOUCH = """#!/bin/sh -e
touch %s"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from avocado.core import exit_codes
from avocado.utils import path, process

from .. import AVOCADO, get_temporary_config
from ... import AVOCADO, get_temporary_config


def missing_binary(binary):
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from avocado.core.result import Result
from avocado.plugins import jsonresult

from .. import TestCaseTmpDir, setup_avocado_loggers
from ... import TestCaseTmpDir, setup_avocado_loggers

setup_avocado_loggers()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from avocado.core import test
from avocado.plugins.legacy import replay as replay_legacy

from .. import setup_avocado_loggers, temp_dir_prefix
from ... import setup_avocado_loggers, temp_dir_prefix

setup_avocado_loggers()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
ExecTestResolver)
from avocado.utils import script

from .. import BASEDIR
from ... import BASEDIR


class ReferenceResolution(unittest.TestCase):
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
from avocado.plugins import vmimage as vmimage_plugin
from avocado.utils import vmimage as vmimage_util

from .. import skipOnLevelsInferiorThan, temp_dir_prefix
from ..functional.test_plugin_vmimage import (create_metadata_file,
missing_binary)
from ... import skipOnLevelsInferiorThan, temp_dir_prefix
from ...functional.plugin.test_vmimage import (create_metadata_file,
missing_binary)

#: extracted from https://dl.fedoraproject.org/pub/fedora/linux/releases/
FEDORA_PAGE = """<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from avocado.core.result import Result
from avocado.plugins import xunit

from .. import setup_avocado_loggers, temp_dir_prefix
from ... import setup_avocado_loggers, temp_dir_prefix

try:
import xmlschema
Expand Down Expand Up @@ -93,9 +93,10 @@ def test_add_success(self):
self.assertEqual(len(els), 1)
self.assertEqual(els[0].attributes['time'].value, '678.237')

junit_xsd = os.path.abspath(os.path.join(os.path.dirname(__file__),
os.path.pardir, ".data",
'jenkins-junit.xsd'))
junit_xsd = os.path.abspath(os.path.join(
os.path.dirname(os.path.dirname(__file__)),
os.path.pardir, ".data",
'jenkins-junit.xsd'))
xml_schema = xmlschema.XMLSchema(junit_xsd)
self.assertTrue(xml_schema.is_valid(xunit_output))

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from avocado.utils import cloudinit, data_factory, iso9660

from .. import setup_avocado_loggers, temp_dir_prefix
from ... import setup_avocado_loggers, temp_dir_prefix

setup_avocado_loggers()

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from avocado.utils import diff_validator

from .. import temp_dir_prefix
from ... import temp_dir_prefix


class ChangeValidationTest(unittest.TestCase):
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from avocado.utils.filelock import AlreadyLocked, FileLock

from .. import temp_dir_prefix
from ... import temp_dir_prefix


class TestFileLock(unittest.TestCase):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from avocado.utils import genio

from .. import setup_avocado_loggers, temp_dir_prefix
from ... import setup_avocado_loggers, temp_dir_prefix

setup_avocado_loggers()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@

from avocado.utils import iso9660, process

from .. import setup_avocado_loggers, temp_dir_prefix
from ... import setup_avocado_loggers, temp_dir_prefix

setup_avocado_loggers()


class Capabilities(unittest.TestCase):

def setUp(self):
self.iso_path = os.path.abspath(os.path.join(os.path.dirname(__file__),
os.path.pardir, ".data",
"sample.iso"))
self.iso_path = os.path.abspath(
os.path.join(os.path.dirname(os.path.dirname(__file__)),
os.path.pardir, ".data", "sample.iso"))

@unittest.mock.patch('avocado.utils.iso9660.has_pycdlib', return_value=True)
def test_capabilities_pycdlib(self, has_pycdlib_mocked):
Expand Down Expand Up @@ -49,9 +49,9 @@ class BaseIso9660:
"""

def setUp(self):
self.iso_path = os.path.abspath(os.path.join(os.path.dirname(__file__),
os.path.pardir, ".data",
"sample.iso"))
self.iso_path = os.path.abspath(
os.path.join(os.path.dirname(os.path.dirname(__file__)),
os.path.pardir, ".data", "sample.iso"))
self.iso = None
prefix = temp_dir_prefix(__name__, self, 'setUp')
self.tmpdir = tempfile.TemporaryDirectory(prefix=prefix)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from avocado.utils.kernel import KernelBuild

from .. import setup_avocado_loggers
from ... import setup_avocado_loggers

setup_avocado_loggers()

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from avocado.utils import path as utils_path
from avocado.utils import process, wait

from .. import temp_dir_prefix
from ... import temp_dir_prefix


def missing_binary(binary):
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

from avocado.utils import path, process, script

from .. import (setup_avocado_loggers, skipOnLevelsInferiorThan,
skipUnlessPathExists)
from ... import (setup_avocado_loggers, skipOnLevelsInferiorThan,
skipUnlessPathExists)

setup_avocado_loggers()

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

from avocado.utils import service

from .. import setup_avocado_loggers
from ... import setup_avocado_loggers

setup_avocado_loggers()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from avocado.utils import distro, software_manager

from .. import setup_avocado_loggers
from ... import setup_avocado_loggers

setup_avocado_loggers()

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from avocado.utils import vmimage

from .. import setup_avocado_loggers
from ... import setup_avocado_loggers

setup_avocado_loggers()

Expand Down

0 comments on commit 78e6c68

Please sign in to comment.