| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent c192638 commit 7fab60c
6 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -14,7 +14,8 @@ | |||
| 14 | 14 | Actor, | |
| 15 | 15 | RepoAliasMixin, | |
| 16 | 16 | Iterable, | |
| 17 | - Actor | ||
| 17 | + Actor, | ||
| 18 | + Stats | ||
| 18 | 19 | ) | |
| 19 | 20 | ||
| 20 | 21 | from util import ( | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,18 @@ | |||
| 1 | + """Provide customized obhject testing facilities""" | ||
| 2 | + | ||
| 3 | + from git.test.lib import ( | ||
| 4 | + rorepo_dir, | ||
| 5 | + TestBase, | ||
| 6 | + assert_equal, | ||
| 7 | + assert_not_equal, | ||
| 8 | + with_rw_repo, | ||
| 9 | + StringProcessAdapter, | ||
| 10 | + ) | ||
| 11 | + from git.repo import Repo | ||
| 12 | + | ||
| 13 | + class TestObjectBase(TestBase): | ||
| 14 | + """Provides a default read-only repository in the rorepo member""" | ||
| 15 | + | ||
| 16 | + @classmethod | ||
| 17 | + def setUpAll(cls): | ||
| 18 | + cls.rorepo = Repo(rorepo_dir()) | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,11 +4,11 @@ | |||
| 4 | 4 | # This module is part of GitPython and is released under | |
| 5 | 5 | # the BSD License: http://www.opensource.org/licenses/bsd-license.php | |
| 6 | 6 | ||
| 7 | - from git.test.lib import TestBase | ||
| 8 | - from git import * | ||
| 7 | + from lib import * | ||
| 8 | + from git.objects.blob import * | ||
| 9 | 9 | from git.util import hex_to_bin | |
| 10 | 10 | ||
| 11 | - class TestBlob(TestBase): | ||
| 11 | + class TestBlob(TestObjectBase): | ||
| 12 | 12 | ||
| 13 | 13 | def test_mime_type_should_return_mime_type_for_known_types(self): | |
| 14 | 14 | blob = Blob(self.rorepo, **{'binsha': Blob.NULL_BIN_SHA, 'path': 'foo.png'}) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,10 +5,14 @@ | |||
| 5 | 5 | # This module is part of GitPython and is released under | |
| 6 | 6 | # the BSD License: http://www.opensource.org/licenses/bsd-license.php | |
| 7 | 7 | ||
| 8 | - from git.test.lib import TestBase | ||
| 9 | - from git import * | ||
| 10 | - from git import IStream | ||
| 11 | - from git.util import hex_to_bin | ||
| 8 | + from lib import * | ||
| 9 | + from git.objects.commit import * | ||
| 10 | + from git.base import IStream | ||
| 11 | + | ||
| 12 | + from git.util import ( | ||
| 13 | + hex_to_bin, | ||
| 14 | + Actor, | ||
| 15 | + ) | ||
| 12 | 16 | ||
| 13 | 17 | from cStringIO import StringIO | |
| 14 | 18 | import time | |
@@ -65,7 +69,7 @@ def assert_commit_serialization(rwrepo, commit_id, print_performance_info=False) | |||
| 65 | 69 | # END handle performance info | |
| 66 | 70 | ||
| 67 | 71 | ||
| 68 | - class TestCommit(TestBase): | ||
| 72 | + class TestCommit(TestObjectBase): | ||
| 69 | 73 | ||
| 70 | 74 | def test_bake(self): | |
| 71 | 75 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,11 +1,12 @@ | |||
| 1 | 1 | # This module is part of GitPython and is released under | |
| 2 | 2 | # the BSD License: http://www.opensource.org/licenses/bsd-license.php | |
| 3 | 3 | ||
| 4 | - from git.test.lib import TestBase | ||
| 4 | + from lib import * | ||
| 5 | 5 | from git.exc import * | |
| 6 | 6 | from git.objects.submodule.base import Submodule | |
| 7 | 7 | from git.objects.submodule.root import RootModule, RootUpdateProgress | |
| 8 | 8 | from git.util import to_native_path_linux, join_path_native | |
| 9 | + | ||
| 9 | 10 | import shutil | |
| 10 | 11 | import git | |
| 11 | 12 | import os | |
@@ -18,7 +19,7 @@ def update(self, op, index, max_count, message=''): | |||
| 18 | 19 | ||
| 19 | 20 | prog = TestRootProgress() | |
| 20 | 21 | ||
| 21 | - class TestSubmodule(TestBase): | ||
| 22 | + class TestSubmodule(TestObjectBase): | ||
| 22 | 23 | ||
| 23 | 24 | k_subm_current = "468cad66ff1f80ddaeee4123c24e4d53a032c00d" | |
| 24 | 25 | k_subm_changed = "394ed7006ee5dc8bddfd132b64001d5dfc0ffdd3" | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,16 +4,18 @@ | |||
| 4 | 4 | # This module is part of GitPython and is released under | |
| 5 | 5 | # the BSD License: http://www.opensource.org/licenses/bsd-license.php | |
| 6 | 6 | ||
| 7 | - import os | ||
| 8 | - from git.test.lib import TestBase | ||
| 9 | - from git import * | ||
| 7 | + | ||
| 8 | + from lib import * | ||
| 10 | 9 | from git.objects.fun import ( | |
| 11 | 10 | traverse_tree_recursive, | |
| 12 | 11 | traverse_trees_recursive | |
| 13 | 12 | ) | |
| 13 | + from git.objects.blob import Blob | ||
| 14 | + from git.objects.tree import Tree | ||
| 14 | 15 | from cStringIO import StringIO | |
| 16 | + import os | ||
| 15 | 17 | ||
| 16 | - class TestTree(TestBase): | ||
| 18 | + class TestTree(TestObjectBase): | ||
| 17 | 19 | ||
| 18 | 20 | def test_serializable(self): | |
| 19 | 21 | # tree at the given commit contains a submodule as well | |
| Back | FazBrowse Home | New Git URL |
0 commit comments