mirror of
https://git.yoctoproject.org/poky
synced 2026-04-15 21:32:13 +02:00
oeqa/cases/oelib: Change default case class to unittest.case.TestCase
Some tests doesn't need call bitbake so it is better to use the basic unittest case class. [YOCTO #10828] (From OE-Core rev: 4d01610f36eaee8da3126bb5045856279371fd17) Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
652df69b02
commit
c3587b7d10
@@ -1,7 +1,7 @@
|
||||
from oeqa.selftest.case import OESelftestTestCase
|
||||
from unittest.case import TestCase
|
||||
import oe.qa
|
||||
|
||||
class TestElf(OESelftestTestCase):
|
||||
class TestElf(TestCase):
|
||||
def test_machine_name(self):
|
||||
"""
|
||||
Test elf_machine_to_string()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from oeqa.selftest.case import OESelftestTestCase
|
||||
from unittest.case import TestCase
|
||||
import oe.license
|
||||
|
||||
class SeenVisitor(oe.license.LicenseVisitor):
|
||||
@@ -9,7 +9,7 @@ class SeenVisitor(oe.license.LicenseVisitor):
|
||||
def visit_Str(self, node):
|
||||
self.seen.append(node.s)
|
||||
|
||||
class TestSingleLicense(OESelftestTestCase):
|
||||
class TestSingleLicense(TestCase):
|
||||
licenses = [
|
||||
"GPLv2",
|
||||
"LGPL-2.0",
|
||||
@@ -37,7 +37,7 @@ class TestSingleLicense(OESelftestTestCase):
|
||||
self.parse(license)
|
||||
self.assertEqual(cm.exception.license, license)
|
||||
|
||||
class TestSimpleCombinations(OESelftestTestCase):
|
||||
class TestSimpleCombinations(TestCase):
|
||||
tests = {
|
||||
"FOO&BAR": ["FOO", "BAR"],
|
||||
"BAZ & MOO": ["BAZ", "MOO"],
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
from oeqa.selftest.case import OESelftestTestCase
|
||||
from unittest.case import TestCase
|
||||
import oe, oe.path
|
||||
import tempfile
|
||||
import os
|
||||
import errno
|
||||
import shutil
|
||||
|
||||
class TestRealPath(OESelftestTestCase):
|
||||
class TestRealPath(TestCase):
|
||||
DIRS = [ "a", "b", "etc", "sbin", "usr", "usr/bin", "usr/binX", "usr/sbin", "usr/include", "usr/include/gdbm" ]
|
||||
FILES = [ "etc/passwd", "b/file" ]
|
||||
LINKS = [
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from oeqa.selftest.case import OESelftestTestCase
|
||||
from unittest.case import TestCase
|
||||
from oe.maketype import create
|
||||
|
||||
class TestBooleanType(OESelftestTestCase):
|
||||
class TestBooleanType(TestCase):
|
||||
def test_invalid(self):
|
||||
self.assertRaises(ValueError, create, '', 'boolean')
|
||||
self.assertRaises(ValueError, create, 'foo', 'boolean')
|
||||
@@ -31,7 +31,7 @@ class TestBooleanType(OESelftestTestCase):
|
||||
self.assertEqual(create('y', 'boolean'), True)
|
||||
self.assertNotEqual(create('y', 'boolean'), False)
|
||||
|
||||
class TestList(OESelftestTestCase):
|
||||
class TestList(TestCase):
|
||||
def assertListEqual(self, value, valid, sep=None):
|
||||
obj = create(value, 'list', separator=sep)
|
||||
self.assertEqual(obj, valid)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from oeqa.selftest.case import OESelftestTestCase
|
||||
from unittest.case import TestCase
|
||||
from oe.utils import packages_filter_out_system, trim_version
|
||||
|
||||
class TestPackagesFilterOutSystem(OESelftestTestCase):
|
||||
class TestPackagesFilterOutSystem(TestCase):
|
||||
def test_filter(self):
|
||||
"""
|
||||
Test that oe.utils.packages_filter_out_system works.
|
||||
@@ -31,7 +31,7 @@ class TestPackagesFilterOutSystem(OESelftestTestCase):
|
||||
self.assertEqual(pkgs, ["foo-data"])
|
||||
|
||||
|
||||
class TestTrimVersion(OESelftestTestCase):
|
||||
class TestTrimVersion(TestCase):
|
||||
def test_version_exception(self):
|
||||
with self.assertRaises(TypeError):
|
||||
trim_version(None, 2)
|
||||
|
||||
Reference in New Issue
Block a user