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):
4241 def test_base_object (self ):
4342 # test interface of base object classes
4443 types = (Blob , Tree , Commit , TagObject )
45- assert len (types ) == len (self .type_tuples )
44+ self . assertEqual ( len (types ), len (self .type_tuples ) )
4645
4746 s = set ()
4847 num_objs = 0
@@ -56,12 +55,12 @@ def test_base_object(self):
5655 item = obj_type (self .rorepo , binsha , 0 , path )
5756 # END handle index objects
5857 num_objs += 1
59- assert item .hexsha == hexsha
60- assert item .type == typename
58+ self . assertEqual ( item .hexsha , hexsha )
59+ self . assertEqual ( item .type , typename )
6160 assert 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 )
6564 assert repr (item )
6665 s .add (item )
6766
@@ -79,16 +78,16 @@ def test_base_object(self):
7978
8079 tmpfilename = tempfile .mktemp (suffix = 'test-stream' )
8180 with open (tmpfilename , 'wb+' ) as tmpfile :
82- assert item == item .stream_data (tmpfile )
81+ self . assertEqual ( item , item .stream_data (tmpfile ) )
8382 tmpfile .seek (0 )
84- assert tmpfile .read () == data
83+ self . assertEqual ( tmpfile .read (), data )
8584 os .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
9392 def test_get_object_type_by_name (self ):
9493 for tname in base .Object .TYPES :
@@ -99,7 +98,7 @@ def test_get_object_type_by_name(self):
9998
10099 def 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 )
105104 def test_with_bare_rw_repo (self , bare_rw_repo ):
@@ -111,7 +110,7 @@ def test_with_rw_repo(self, rw_repo):
111110 assert not rw_repo .config_reader ("repository" ).getboolean ("core" , "bare" )
112111 assert 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... ")
115114 def test_with_rw_remote_and_rw_repo (self ):
116115 with rw_and_rw_remote_repos (self .rorepo , '0.1.6' ) as (rw_repo , rw_remote_repo ):
117116 assert not rw_repo .config_reader ("repository" ).getboolean ("core" , "bare" )
0 commit comments