@@ -185,8 +185,7 @@ def test_diff_tree(self):
185185 commit_b = self .repo [COMMIT_SHA1_2 ]
186186
187187 def _test (diff ):
188- # self.assertIsNotNone is 2.7 only
189- self .assertTrue (diff is not None )
188+ self .assertIsNotNone (diff )
190189 # self.assertIn is 2.7 only
191190 self .assertEqual (2 , sum (map (lambda x : len (x .hunks ), diff )))
192191
@@ -247,21 +246,15 @@ def test_diff_merge(self):
247246 commit_c = self .repo [COMMIT_SHA1_3 ]
248247
249248 diff_b = commit_a .tree .diff_to_tree (commit_b .tree )
250- # self.assertIsNotNone is 2.7 only
251- self .assertTrue (diff_b is not None )
249+ self .assertIsNotNone (diff_b )
252250
253251 diff_c = commit_b .tree .diff_to_tree (commit_c .tree )
254- # self.assertIsNotNone is 2.7 only
255- self .assertTrue (diff_c is not None )
256-
257- # assertIn / assertNotIn are 2.7 only
258- self .assertFalse ('b' in [patch .delta .new_file .path for patch in diff_b ])
259- self .assertTrue ('b' in [patch .delta .new_file .path for patch in diff_c ])
252+ self .assertIsNotNone (diff_c )
253+ self .assertNotIn ('b' , [patch .delta .new_file .path for patch in diff_b ])
254+ self .assertIn ('b' , [patch .delta .new_file .path for patch in diff_c ])
260255
261256 diff_b .merge (diff_c )
262-
263- # assertIn is 2.7 only
264- self .assertTrue ('b' in [patch .delta .new_file .path for patch in diff_b ])
257+ self .assertIn ('b' , [patch .delta .new_file .path for patch in diff_b ])
265258
266259 patch = diff_b [0 ]
267260 hunk = patch .hunks [0 ]
@@ -297,6 +290,8 @@ def test_hunk_content(self):
297290 hunk = patch .hunks [0 ]
298291 lines = ('{0} {1}' .format (x .origin , x .content ) for x in hunk .lines )
299292 self .assertEqual (HUNK_EXPECTED , '' .join (lines ))
293+ for line in hunk .lines :
294+ self .assertEqual (line .content , line .raw_content .decode ())
300295
301296 def test_find_similar (self ):
302297 commit_a = self .repo [COMMIT_SHA1_6 ]
0 commit comments