summaryrefslogtreecommitdiff
path: root/git/test/test_base.py
diff options
context:
space:
mode:
authorKostis Anagnostopoulos <ankostis@gmail.com>2016-10-12 21:13:20 +0200
committerKostis Anagnostopoulos <ankostis@gmail.com>2016-10-13 02:03:35 +0200
commit83645971b8e134f45bded528e0e0786819203252 (patch)
treeb03d7e77d88c297d52c3ac7280afba65cf1a59e2 /git/test/test_base.py
parent6310480763cdf01d8816d0c261c0ed7b516d437a (diff)
downloadgitpython-83645971b8e134f45bded528e0e0786819203252.tar.gz
test, #525: allow disabling freeze errors separately
+ cmd: use DEVNULL for non PIPEs; no open-file. + TCs: some unitestize-assertions on base & remote TCs.
Diffstat (limited to 'git/test/test_base.py')
-rw-r--r--git/test/test_base.py25
1 files changed, 13 insertions, 12 deletions
diff --git a/git/test/test_base.py b/git/test/test_base.py
index a4382d3e..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,6 +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_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")