diff options
Diffstat (limited to 'meta/lib')
-rw-r--r-- | meta/lib/oeqa/selftest/cases/oelib/buildhistory.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/meta/lib/oeqa/selftest/cases/oelib/buildhistory.py b/meta/lib/oeqa/selftest/cases/oelib/buildhistory.py index 4e877517c1..f9bec53d4a 100644 --- a/meta/lib/oeqa/selftest/cases/oelib/buildhistory.py +++ b/meta/lib/oeqa/selftest/cases/oelib/buildhistory.py | |||
@@ -1,9 +1,7 @@ | |||
1 | import os | 1 | import os |
2 | from oeqa.selftest.case import OESelftestTestCase | 2 | from oeqa.selftest.case import OESelftestTestCase |
3 | import tempfile | 3 | import tempfile |
4 | from git import Repo | ||
5 | from oeqa.utils.commands import get_bb_var | 4 | from oeqa.utils.commands import get_bb_var |
6 | from oe.buildhistory_analysis import blob_to_dict, compare_dict_blobs | ||
7 | 5 | ||
8 | class TestBlobParsing(OESelftestTestCase): | 6 | class TestBlobParsing(OESelftestTestCase): |
9 | 7 | ||
@@ -12,7 +10,12 @@ class TestBlobParsing(OESelftestTestCase): | |||
12 | self.repo_path = tempfile.mkdtemp(prefix='selftest-buildhistory', | 10 | self.repo_path = tempfile.mkdtemp(prefix='selftest-buildhistory', |
13 | dir=get_bb_var('TOPDIR')) | 11 | dir=get_bb_var('TOPDIR')) |
14 | 12 | ||
15 | self.repo = Repo.init(self.repo_path) | 13 | try: |
14 | from git import Repo | ||
15 | self.repo = Repo.init(self.repo_path) | ||
16 | except ImportError: | ||
17 | self.skipTest('Python module GitPython is not present') | ||
18 | |||
16 | self.test_file = "test" | 19 | self.test_file = "test" |
17 | self.var_map = {} | 20 | self.var_map = {} |
18 | 21 | ||
@@ -40,6 +43,7 @@ class TestBlobParsing(OESelftestTestCase): | |||
40 | """ | 43 | """ |
41 | Test convertion of git blobs to dictionary | 44 | Test convertion of git blobs to dictionary |
42 | """ | 45 | """ |
46 | from oe.buildhistory_analysis import blob_to_dict | ||
43 | valuesmap = { "foo" : "1", "bar" : "2" } | 47 | valuesmap = { "foo" : "1", "bar" : "2" } |
44 | self.commit_vars(to_add = valuesmap) | 48 | self.commit_vars(to_add = valuesmap) |
45 | 49 | ||
@@ -51,6 +55,8 @@ class TestBlobParsing(OESelftestTestCase): | |||
51 | """ | 55 | """ |
52 | Test comparisson of dictionaries extracted from git blobs | 56 | Test comparisson of dictionaries extracted from git blobs |
53 | """ | 57 | """ |
58 | from oe.buildhistory_analysis import compare_dict_blobs | ||
59 | |||
54 | changesmap = { "foo-2" : ("2", "8"), "bar" : ("","4"), "bar-2" : ("","5")} | 60 | changesmap = { "foo-2" : ("2", "8"), "bar" : ("","4"), "bar-2" : ("","5")} |
55 | 61 | ||
56 | self.commit_vars(to_add = { "foo" : "1", "foo-2" : "2", "foo-3" : "3" }) | 62 | self.commit_vars(to_add = { "foo" : "1", "foo-2" : "2", "foo-3" : "3" }) |
@@ -69,6 +75,7 @@ class TestBlobParsing(OESelftestTestCase): | |||
69 | """ | 75 | """ |
70 | Test default values for comparisson of git blob dictionaries | 76 | Test default values for comparisson of git blob dictionaries |
71 | """ | 77 | """ |
78 | from oe.buildhistory_analysis import compare_dict_blobs | ||
72 | defaultmap = { x : ("default", "1") for x in ["PKG", "PKGE", "PKGV", "PKGR"]} | 79 | defaultmap = { x : ("default", "1") for x in ["PKG", "PKGE", "PKGV", "PKGR"]} |
73 | 80 | ||
74 | self.commit_vars(to_add = { "foo" : "1" }) | 81 | self.commit_vars(to_add = { "foo" : "1" }) |