oeqa: move lib/oe tests to oe-selftest

These tests don't get ran often (as demonstrated by the fact that some were not
ported to Python 3), so move them to oeqa/selftest so they get executed
frequently and can be extended easily.

[ YOCTO #7376 ]

(From OE-Core rev: 2001979ad41e6fdd5a37b0f90a96708f39c9df07)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Ross Burton 2016-12-13 16:31:02 +00:00 committed by Richard Purdie
parent 94c29c1008
commit d535aba974
6 changed files with 4 additions and 16 deletions

View File

@ -1,19 +1,7 @@
import unittest
from oe.maketype import create, factory
from oe.maketype import create
class TestTypes(unittest.TestCase):
def assertIsInstance(self, obj, cls):
return self.assertTrue(isinstance(obj, cls))
def assertIsNot(self, obj, other):
return self.assertFalse(obj is other)
def assertFactoryCreated(self, value, type, **flags):
cls = factory(type)
self.assertIsNot(cls, None)
self.assertIsInstance(create(value, type, **flags), cls)
class TestBooleanType(TestTypes):
class TestBooleanType(unittest.TestCase):
def test_invalid(self):
self.assertRaises(ValueError, create, '', 'boolean')
self.assertRaises(ValueError, create, 'foo', 'boolean')
@ -43,7 +31,7 @@ class TestBooleanType(TestTypes):
self.assertEqual(create('y', 'boolean'), True)
self.assertNotEqual(create('y', 'boolean'), False)
class TestList(TestTypes):
class TestList(unittest.TestCase):
def assertListEqual(self, value, valid, sep=None):
obj = create(value, 'list', separator=sep)
self.assertEqual(obj, valid)

View File

@ -1,5 +1,5 @@
import unittest
from oe.utils import packages_filter_out_system
from oe.utils import packages_filter_out_system, trim_version
class TestPackagesFilterOutSystem(unittest.TestCase):
def test_filter(self):