2525from git .objects .util import get_object_type_by_name
2626from gitdb .util import hex_to_bin
2727from git .compat import is_win
28- from git .util import HIDE_WINDOWS_KNOWN_ERRORS
2928
3029
3130class TestBase (TestBase ):
@@ -42,7 +41,7 @@ def tearDown(self):
4241def test_base_object (self ):
4342# test interface of base object classes
4443types = (Blob ,Tree ,Commit ,TagObject )
45- assert len (types )== len (self .type_tuples )
44+ self . assertEqual ( len (types ), len (self .type_tuples ) )
4645
4746s = set ()
4847num_objs = 0
@@ -56,12 +55,12 @@ def test_base_object(self):
5655item = obj_type (self .rorepo ,binsha ,0 ,path )
5756# END handle index objects
5857num_objs += 1
59- assert item .hexsha == hexsha
60- assert item .type == typename
58+ self . assertEqual ( item .hexsha , hexsha )
59+ self . assertEqual ( item .type , typename )
6160assert item .size
62- assert item == item
63- assert not item != item
64- assert str (item )== item .hexsha
61+ self . assertEqual ( item , item )
62+ self . assertNotEqual ( not item , item )
63+ self . assertEqual ( str (item ), item .hexsha )
6564assert repr (item )
6665s .add (item )
6766
@@ -79,16 +78,16 @@ def test_base_object(self):
7978
8079tmpfilename = tempfile .mktemp (suffix = 'test-stream' )
8180with open (tmpfilename ,'wb+' )as tmpfile :
82- assert item == item .stream_data (tmpfile )
81+ self . assertEqual ( item , item .stream_data (tmpfile ) )
8382tmpfile .seek (0 )
84- assert tmpfile .read ()== data
83+ self . assertEqual ( tmpfile .read (), data )
8584os .remove (tmpfilename )
8685# END for each object type to create
8786
8887# each has a unique sha
89- assert len (s )== num_objs
90- assert len (s | s )== num_objs
91- assert num_index_objs == 2
88+ self . assertEqual ( len (s ), num_objs )
89+ self . assertEqual ( len (s | s ), num_objs )
90+ self . assertEqual ( num_index_objs , 2 )
9291
9392def test_get_object_type_by_name (self ):
9493for tname in base .Object .TYPES :
@@ -99,7 +98,7 @@ def test_get_object_type_by_name(self):
9998
10099def test_object_resolution (self ):
101100# objects must be resolved to shas so they compare equal
102- assert self .rorepo .head .reference .object == self .rorepo .active_branch .object
101+ self .assertEqual ( self . rorepo .head .reference .object , self .rorepo .active_branch .object )
103102
104103@with_rw_repo ('HEAD' ,bare = True )
105104def test_with_bare_rw_repo (self ,bare_rw_repo ):
@@ -111,7 +110,7 @@ def test_with_rw_repo(self, rw_repo):
111110assert not rw_repo .config_reader ("repository" ).getboolean ("core" ,"bare" )
112111assert os .path .isdir (os .path .join (rw_repo .working_tree_dir ,'lib' ))
113112
114- @skipIf (HIDE_WINDOWS_KNOWN_ERRORS ,"FIXME: Freezes!" )
113+ # @skipIf(HIDE_WINDOWS_FREEZE_ERRORS , "FIXME: Freezes! sometimes... ")
115114def test_with_rw_remote_and_rw_repo (self ):
116115with rw_and_rw_remote_repos (self .rorepo ,'0.1.6' )as (rw_repo ,rw_remote_repo ):
117116assert not rw_repo .config_reader ("repository" ).getboolean ("core" ,"bare" )