summaryrefslogtreecommitdiff
path: root/git/test/test_base.py
diff options
context:
space:
mode:
authorKostis Anagnostopoulos <ankostis@gmail.com>2016-10-14 17:42:46 +0200
committerGitHub <noreply@github.com>2016-10-14 17:42:46 +0200
commite12ef59c559e3be8fa4a65e17c9c764da535716e (patch)
treee37739f510a328496230859cb316ce263b78e470 /git/test/test_base.py
parente3165753f9d0d69caabac74eee195887f3fea482 (diff)
parentc8e914eb0dfe6a0eb2de66b6826af5f715aeed6d (diff)
downloadgitpython-e12ef59c559e3be8fa4a65e17c9c764da535716e.tar.gz
Merge pull request #530 fixing some #525 Windows errors
+ git-daemon: + Use git-daemon PORT above 10k; on Windows all below need Admin rights. + Used relative daemon-paths with `--base-pth`. + Simplify git-daemon start/stop/ex-hanlding. +FIXED git-daemon @with_rw_and_rw_remote_repo(): + "Polish" most remote & config urls, converting \-->/. + test_base.test_with_rw_remote_and_rw_repo() PASS. + Remote: + test_remote: apply polish-urls on `_do_test_fetch()` checking function. + test_remote.test_base() now freezes on Windows! (so still hidden win_err). pump fetch-infos instead of GIL-reading stderr. + Push-cmd also keep (and optionally raise) any error messages. + `cmd.handle_process_output()` accepts null-finalizer, to pump completely stderr before raising any errors. + test: Enable `TestGit.test_environment()` on Windows (to checks stderr consumption). + util: delete unused `absolute_project_path()`. + Control separately *freezing* TCs on Windows with `git.util.HIDE_WINDOWS_FREEZE_ERRORS` flag.
Diffstat (limited to 'git/test/test_base.py')
-rw-r--r--git/test/test_base.py36
1 files changed, 13 insertions, 23 deletions
diff --git a/git/test/test_base.py b/git/test/test_base.py
index 2956f3d4..7fc3096f 100644
--- a/git/test/test_base.py
+++ b/git/test/test_base.py
@@ -41,7 +41,7 @@ class TestBase(TestBase):
def test_base_object(self):
# test interface of base object classes
types = (Blob, Tree, Commit, TagObject)
- assert len(types) == len(self.type_tuples)
+ self.assertEqual(len(types), len(self.type_tuples))
s = set()
num_objs = 0
@@ -55,12 +55,12 @@ class TestBase(TestBase):
item = obj_type(self.rorepo, binsha, 0, path)
# END handle index objects
num_objs += 1
- assert item.hexsha == hexsha
- assert item.type == typename
+ self.assertEqual(item.hexsha, hexsha)
+ self.assertEqual(item.type, typename)
assert item.size
- assert item == item
- assert not item != item
- assert str(item) == item.hexsha
+ self.assertEqual(item, item)
+ self.assertNotEqual(not item, item)
+ self.assertEqual(str(item), item.hexsha)
assert repr(item)
s.add(item)
@@ -78,16 +78,16 @@ class TestBase(TestBase):
tmpfilename = tempfile.mktemp(suffix='test-stream')
with open(tmpfilename, 'wb+') as tmpfile:
- assert item == item.stream_data(tmpfile)
+ self.assertEqual(item, item.stream_data(tmpfile))
tmpfile.seek(0)
- assert tmpfile.read() == data
+ self.assertEqual(tmpfile.read(), data)
os.remove(tmpfilename)
# END for each object type to create
# each has a unique sha
- assert len(s) == num_objs
- assert len(s | s) == num_objs
- assert num_index_objs == 2
+ self.assertEqual(len(s), num_objs)
+ self.assertEqual(len(s | s), num_objs)
+ self.assertEqual(num_index_objs, 2)
def test_get_object_type_by_name(self):
for tname in base.Object.TYPES:
@@ -98,7 +98,7 @@ class TestBase(TestBase):
def test_object_resolution(self):
# objects must be resolved to shas so they compare equal
- assert self.rorepo.head.reference.object == self.rorepo.active_branch.object
+ self.assertEqual(self.rorepo.head.reference.object, self.rorepo.active_branch.object)
@with_rw_repo('HEAD', bare=True)
def test_with_bare_rw_repo(self, bare_rw_repo):
@@ -110,17 +110,7 @@ class TestBase(TestBase):
assert not rw_repo.config_reader("repository").getboolean("core", "bare")
assert os.path.isdir(os.path.join(rw_repo.working_tree_dir, 'lib'))
- # @skipIf(HIDE_WINDOWS_KNOWN_ERRORS, """
- # FIXME: helper.wrapper fails with:
- # PermissionError: [WinError 5] Access is denied:
- # 'C:\\Users\\appveyor\\AppData\\Local\\Temp\\1\\test_work_tree_unsupportedryfa60di\\
- # master_repo\\.git\\objects\\pack\\pack-bc9e0787aef9f69e1591ef38ea0a6f566ec66fe3.idx'
- # AND
- # FIXME: git-daemon failing with:
- # git.exc.GitCommandError: Cmd('git') failed due to: exit code(128)
- # cmdline: git ls-remote daemon_origin
- # stderr: 'fatal: bad config line 15 in file .git/config'
- # """)
+ #@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")