diff options
Diffstat (limited to 'meta/lib/oeqa/core/tests')
-rw-r--r-- | meta/lib/oeqa/core/tests/cases/loader/invalid/oeid.py | 15 | ||||
-rw-r--r-- | meta/lib/oeqa/core/tests/cases/oeid.py | 18 | ||||
-rwxr-xr-x | meta/lib/oeqa/core/tests/test_decorators.py | 23 | ||||
-rwxr-xr-x | meta/lib/oeqa/core/tests/test_loader.py | 11 |
4 files changed, 5 insertions, 62 deletions
diff --git a/meta/lib/oeqa/core/tests/cases/loader/invalid/oeid.py b/meta/lib/oeqa/core/tests/cases/loader/invalid/oeid.py deleted file mode 100644 index 038d445931..0000000000 --- a/meta/lib/oeqa/core/tests/cases/loader/invalid/oeid.py +++ /dev/null | |||
@@ -1,15 +0,0 @@ | |||
1 | # Copyright (C) 2016 Intel Corporation | ||
2 | # Released under the MIT license (see COPYING.MIT) | ||
3 | |||
4 | from oeqa.core.case import OETestCase | ||
5 | |||
6 | class AnotherIDTest(OETestCase): | ||
7 | |||
8 | def testAnotherIdGood(self): | ||
9 | self.assertTrue(True, msg='How is this possible?') | ||
10 | |||
11 | def testAnotherIdOther(self): | ||
12 | self.assertTrue(True, msg='How is this possible?') | ||
13 | |||
14 | def testAnotherIdNone(self): | ||
15 | self.assertTrue(True, msg='How is this possible?') | ||
diff --git a/meta/lib/oeqa/core/tests/cases/oeid.py b/meta/lib/oeqa/core/tests/cases/oeid.py deleted file mode 100644 index c2d3d32f2d..0000000000 --- a/meta/lib/oeqa/core/tests/cases/oeid.py +++ /dev/null | |||
@@ -1,18 +0,0 @@ | |||
1 | # Copyright (C) 2016 Intel Corporation | ||
2 | # Released under the MIT license (see COPYING.MIT) | ||
3 | |||
4 | from oeqa.core.case import OETestCase | ||
5 | from oeqa.core.decorator.oeid import OETestID | ||
6 | |||
7 | class IDTest(OETestCase): | ||
8 | |||
9 | @OETestID(101) | ||
10 | def testIdGood(self): | ||
11 | self.assertTrue(True, msg='How is this possible?') | ||
12 | |||
13 | @OETestID(102) | ||
14 | def testIdOther(self): | ||
15 | self.assertTrue(True, msg='How is this possible?') | ||
16 | |||
17 | def testIdNone(self): | ||
18 | self.assertTrue(True, msg='How is this possible?') | ||
diff --git a/meta/lib/oeqa/core/tests/test_decorators.py b/meta/lib/oeqa/core/tests/test_decorators.py index f7d11e885a..67dce773bd 100755 --- a/meta/lib/oeqa/core/tests/test_decorators.py +++ b/meta/lib/oeqa/core/tests/test_decorators.py | |||
@@ -42,29 +42,6 @@ class TestFilterDecorator(TestBase): | |||
42 | for test in tests: | 42 | for test in tests: |
43 | self._runFilterTest(['oetag'], test[0], test[1], test[2]) | 43 | self._runFilterTest(['oetag'], test[0], test[1], test[2]) |
44 | 44 | ||
45 | def test_oeid(self): | ||
46 | # Get all cases without filtering. | ||
47 | filter_all = {} | ||
48 | test_all = {'testIdGood', 'testIdOther', 'testIdNone'} | ||
49 | msg_all = 'Failed to get all oeid cases without filtering.' | ||
50 | |||
51 | # Get cases with '101' oeid. | ||
52 | filter_good = {'oeid': 101} | ||
53 | test_good = {'testIdGood'} | ||
54 | msg_good = 'Failed to get just one tes filtering with "101" oeid.' | ||
55 | |||
56 | # Get cases with an invalid id. | ||
57 | filter_invalid = {'oeid':999} | ||
58 | test_invalid = set() | ||
59 | msg_invalid = 'Failed to filter all test using an invalid oeid.' | ||
60 | |||
61 | tests = ((filter_all, test_all, msg_all), | ||
62 | (filter_good, test_good, msg_good), | ||
63 | (filter_invalid, test_invalid, msg_invalid)) | ||
64 | |||
65 | for test in tests: | ||
66 | self._runFilterTest(['oeid'], test[0], test[1], test[2]) | ||
67 | |||
68 | class TestDependsDecorator(TestBase): | 45 | class TestDependsDecorator(TestBase): |
69 | modules = ['depends'] | 46 | modules = ['depends'] |
70 | 47 | ||
diff --git a/meta/lib/oeqa/core/tests/test_loader.py b/meta/lib/oeqa/core/tests/test_loader.py index b79b8bad4d..39f2d6e2a7 100755 --- a/meta/lib/oeqa/core/tests/test_loader.py +++ b/meta/lib/oeqa/core/tests/test_loader.py | |||
@@ -42,7 +42,7 @@ class TestLoader(TestBase): | |||
42 | cases_path = self.cases_path | 42 | cases_path = self.cases_path |
43 | invalid_path = os.path.join(cases_path, 'loader', 'invalid') | 43 | invalid_path = os.path.join(cases_path, 'loader', 'invalid') |
44 | self.cases_path = [self.cases_path, invalid_path] | 44 | self.cases_path = [self.cases_path, invalid_path] |
45 | expect = 'Duplicated oeid module found in' | 45 | expect = 'Duplicated oetag module found in' |
46 | msg = 'Expected ImportError exception for having duplicated module' | 46 | msg = 'Expected ImportError exception for having duplicated module' |
47 | try: | 47 | try: |
48 | # Must throw ImportEror because duplicated module | 48 | # Must throw ImportEror because duplicated module |
@@ -55,17 +55,16 @@ class TestLoader(TestBase): | |||
55 | self.cases_path = cases_path | 55 | self.cases_path = cases_path |
56 | 56 | ||
57 | def test_filter_modules(self): | 57 | def test_filter_modules(self): |
58 | expected_modules = {'oeid', 'oetag'} | 58 | expected_modules = {'oetag'} |
59 | tc = self._testLoader(modules=expected_modules) | 59 | tc = self._testLoader(modules=expected_modules) |
60 | modules = getSuiteModules(tc.suites) | 60 | modules = getSuiteModules(tc.suites) |
61 | msg = 'Expected just %s modules' % ', '.join(expected_modules) | 61 | msg = 'Expected just %s modules' % ', '.join(expected_modules) |
62 | self.assertEqual(modules, expected_modules, msg=msg) | 62 | self.assertEqual(modules, expected_modules, msg=msg) |
63 | 63 | ||
64 | def test_filter_cases(self): | 64 | def test_filter_cases(self): |
65 | modules = ['oeid', 'oetag', 'data'] | 65 | modules = ['oetag', 'data'] |
66 | expected_cases = {'data.DataTest.testDataOk', | 66 | expected_cases = {'data.DataTest.testDataOk', |
67 | 'oetag.TagTest.testTagGood', | 67 | 'oetag.TagTest.testTagGood'} |
68 | 'oeid.IDTest.testIdGood'} | ||
69 | tc = self._testLoader(modules=modules, tests=expected_cases) | 68 | tc = self._testLoader(modules=modules, tests=expected_cases) |
70 | cases = set(getSuiteCasesIDs(tc.suites)) | 69 | cases = set(getSuiteCasesIDs(tc.suites)) |
71 | msg = 'Expected just %s cases' % ', '.join(expected_cases) | 70 | msg = 'Expected just %s cases' % ', '.join(expected_cases) |
@@ -74,7 +73,7 @@ class TestLoader(TestBase): | |||
74 | def test_import_from_paths(self): | 73 | def test_import_from_paths(self): |
75 | cases_path = self.cases_path | 74 | cases_path = self.cases_path |
76 | cases2_path = os.path.join(cases_path, 'loader', 'valid') | 75 | cases2_path = os.path.join(cases_path, 'loader', 'valid') |
77 | expected_modules = {'oeid', 'another'} | 76 | expected_modules = {'another'} |
78 | self.cases_path = [self.cases_path, cases2_path] | 77 | self.cases_path = [self.cases_path, cases2_path] |
79 | tc = self._testLoader(modules=expected_modules) | 78 | tc = self._testLoader(modules=expected_modules) |
80 | modules = getSuiteModules(tc.suites) | 79 | modules = getSuiteModules(tc.suites) |