From 0210e394e0776d0b7097bf666bebd690ed0c0e4f Mon Sep 17 00:00:00 2001 From: Kostis Anagnostopoulos Date: Sat, 15 Oct 2016 13:11:16 +0200 Subject: src: import os.path as osp --- git/test/test_base.py | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'git/test/test_base.py') diff --git a/git/test/test_base.py b/git/test/test_base.py index 7fc3096f..576df961 100644 --- a/git/test/test_base.py +++ b/git/test/test_base.py @@ -9,22 +9,24 @@ import sys import tempfile from unittest import skipIf -import git.objects.base as base -from git.test.lib import ( - TestBase, - assert_raises, - with_rw_repo, - with_rw_and_rw_remote_repo -) from git import ( Blob, Tree, Commit, TagObject ) +from git.compat import is_win from git.objects.util import get_object_type_by_name +from git.test.lib import ( + TestBase, + assert_raises, + with_rw_repo, + with_rw_and_rw_remote_repo +) from gitdb.util import hex_to_bin -from git.compat import is_win + +import git.objects.base as base +import os.path as osp class TestBase(TestBase): @@ -103,19 +105,19 @@ class TestBase(TestBase): @with_rw_repo('HEAD', bare=True) def test_with_bare_rw_repo(self, bare_rw_repo): assert bare_rw_repo.config_reader("repository").getboolean("core", "bare") - assert os.path.isfile(os.path.join(bare_rw_repo.git_dir, 'HEAD')) + assert osp.isfile(osp.join(bare_rw_repo.git_dir, 'HEAD')) @with_rw_repo('0.1.6') def test_with_rw_repo(self, rw_repo): assert not rw_repo.config_reader("repository").getboolean("core", "bare") - assert os.path.isdir(os.path.join(rw_repo.working_tree_dir, 'lib')) + assert osp.isdir(osp.join(rw_repo.working_tree_dir, 'lib')) #@skipIf(HIDE_WINDOWS_FREEZE_ERRORS, "FIXME: Freezes! sometimes...") @with_rw_and_rw_remote_repo('0.1.6') def test_with_rw_remote_and_rw_repo(self, rw_repo, rw_remote_repo): assert not rw_repo.config_reader("repository").getboolean("core", "bare") assert rw_remote_repo.config_reader("repository").getboolean("core", "bare") - assert os.path.isdir(os.path.join(rw_repo.working_tree_dir, 'lib')) + assert osp.isdir(osp.join(rw_repo.working_tree_dir, 'lib')) @skipIf(sys.version_info < (3,) and is_win, "Unicode woes, see https://github.com/gitpython-developers/GitPython/pull/519") @@ -123,7 +125,7 @@ class TestBase(TestBase): def test_add_unicode(self, rw_repo): filename = u"שלום.txt" - file_path = os.path.join(rw_repo.working_dir, filename) + file_path = osp.join(rw_repo.working_dir, filename) # verify first that we could encode file name in this environment try: -- cgit v1.2.3 From b02662d4e870a34d2c6d97d4f702fcc1311e5177 Mon Sep 17 00:00:00 2001 From: Kostis Anagnostopoulos Date: Sat, 15 Oct 2016 13:42:33 +0200 Subject: src: reduce needless deps to `gitdb.util` --- git/test/test_base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'git/test/test_base.py') diff --git a/git/test/test_base.py b/git/test/test_base.py index 576df961..cec40de8 100644 --- a/git/test/test_base.py +++ b/git/test/test_base.py @@ -23,7 +23,7 @@ from git.test.lib import ( with_rw_repo, with_rw_and_rw_remote_repo ) -from gitdb.util import hex_to_bin +from git.util import hex_to_bin import git.objects.base as base import os.path as osp -- cgit v1.2.3