| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,8 +7,7 @@ | |||
| 7 | 7 | from unittest.mock import patch | |
| 8 | 8 | ||
| 9 | 9 | from nose.tools import ( | |
| 10 | - assert_true, # @UnusedImport | ||
| 11 | 10 | assert_false # @UnusedImport | |
| 12 | 11 | ) | |
| 13 | 12 | ||
| 14 | - __all__ = ['patch', 'assert_true', 'assert_false'] | ||
| 13 | + __all__ = ['patch', 'assert_false'] | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -20,7 +20,6 @@ | |||
| 20 | 20 | TestBase, | |
| 21 | 21 | StringProcessAdapter, | |
| 22 | 22 | fixture, | |
| 23 | - assert_true, | ||
| 24 | 23 | ) | |
| 25 | 24 | from git.test.lib import with_rw_directory | |
| 26 | 25 | ||
@@ -105,8 +104,8 @@ def test_diff_with_rename(self): | |||
| 105 | 104 | self.assertEqual(1, len(diffs)) | |
| 106 | 105 | ||
| 107 | 106 | diff = diffs[0] | |
| 108 | - assert_true(diff.renamed_file) | ||
| 109 | - assert_true(diff.renamed) | ||
| 107 | + self.assertTrue(diff.renamed_file) | ||
| 108 | + self.assertTrue(diff.renamed) | ||
| 110 | 109 | self.assertEqual(diff.rename_from, u'Jérôme') | |
| 111 | 110 | self.assertEqual(diff.rename_to, u'müller') | |
| 112 | 111 | self.assertEqual(diff.raw_rename_from, b'J\xc3\xa9r\xc3\xb4me') | |
@@ -133,9 +132,9 @@ def test_diff_with_copied_file(self): | |||
| 133 | 132 | self.assertEqual(1, len(diffs)) | |
| 134 | 133 | ||
| 135 | 134 | diff = diffs[0] | |
| 136 | - assert_true(diff.copied_file) | ||
| 137 | - assert_true(diff.a_path, u'test1.txt') | ||
| 138 | - assert_true(diff.b_path, u'test2.txt') | ||
| 135 | + self.assertTrue(diff.copied_file) | ||
| 136 | + self.assertTrue(diff.a_path, u'test1.txt') | ||
| 137 | + self.assertTrue(diff.b_path, u'test2.txt') | ||
| 139 | 138 | assert isinstance(str(diff), str) | |
| 140 | 139 | ||
| 141 | 140 | output = StringProcessAdapter(fixture('diff_copied_mode_raw')) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -19,7 +19,6 @@ | |||
| 19 | 19 | find_worktree_git_dir | |
| 20 | 20 | ) | |
| 21 | 21 | from git.test.lib import ( | |
| 22 | - assert_true, | ||
| 23 | 22 | TestBase, | |
| 24 | 23 | with_rw_repo, | |
| 25 | 24 | with_rw_directory | |
@@ -274,12 +273,12 @@ def test_linked_worktree_traversal(self, rw_dir): | |||
| 274 | 273 | ||
| 275 | 274 | dotgit = osp.join(worktree_path, ".git") | |
| 276 | 275 | statbuf = stat(dotgit) | |
| 277 | - assert_true(statbuf.st_mode & S_IFREG) | ||
| 276 | + self.assertTrue(statbuf.st_mode & S_IFREG) | ||
| 278 | 277 | ||
| 279 | 278 | gitdir = find_worktree_git_dir(dotgit) | |
| 280 | 279 | self.assertIsNotNone(gitdir) | |
| 281 | 280 | statbuf = stat(gitdir) | |
| 282 | - assert_true(statbuf.st_mode & S_IFDIR) | ||
| 281 | + self.assertTrue(statbuf.st_mode & S_IFDIR) | ||
| 283 | 282 | ||
| 284 | 283 | def test_tree_entries_from_data_with_failing_name_decode_py3(self): | |
| 285 | 284 | r = tree_entries_from_data(b'100644 \x9f\0aaa') | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -22,7 +22,6 @@ | |||
| 22 | 22 | from git.test.lib import ( | |
| 23 | 23 | TestBase, | |
| 24 | 24 | patch, | |
| 25 | - assert_true, | ||
| 26 | 25 | fixture_path | |
| 27 | 26 | ) | |
| 28 | 27 | from git.test.lib import with_rw_directory | |
@@ -48,7 +47,7 @@ def tearDown(self): | |||
| 48 | 47 | def test_call_process_calls_execute(self, git): | |
| 49 | 48 | git.return_value = '' | |
| 50 | 49 | self.git.version() | |
| 51 | - assert_true(git.called) | ||
| 50 | + self.assertTrue(git.called) | ||
| 52 | 51 | self.assertEqual(git.call_args, ((['git', 'version'],), {})) | |
| 53 | 52 | ||
| 54 | 53 | def test_call_unpack_args_unicode(self): | |
@@ -95,7 +94,7 @@ def test_it_accepts_stdin(self): | |||
| 95 | 94 | def test_it_ignores_false_kwargs(self, git): | |
| 96 | 95 | # this_should_not_be_ignored=False implies it *should* be ignored | |
| 97 | 96 | self.git.version(pass_this_kwarg=False) | |
| 98 | - assert_true("pass_this_kwarg" not in git.call_args[1]) | ||
| 97 | + self.assertTrue("pass_this_kwarg" not in git.call_args[1]) | ||
| 99 | 98 | ||
| 100 | 99 | def test_it_raises_proper_exception_with_output_stream(self): | |
| 101 | 100 | tmp_file = TemporaryFile() | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -41,8 +41,7 @@ | |||
| 41 | 41 | TestBase, | |
| 42 | 42 | with_rw_repo, | |
| 43 | 43 | fixture, | |
| 44 | - assert_false, | ||
| 45 | - assert_true | ||
| 44 | + assert_false | ||
| 46 | 45 | ) | |
| 47 | 46 | from git.util import HIDE_WINDOWS_KNOWN_ERRORS, cygpath | |
| 48 | 47 | from git.test.lib import with_rw_directory | |
@@ -243,12 +242,12 @@ def test_clone_from_with_path_contains_unicode(self): | |||
| 243 | 242 | ||
| 244 | 243 | @with_rw_repo('HEAD') | |
| 245 | 244 | def test_max_chunk_size(self, repo): | |
| 246 | - class TestOutputStream(object): | ||
| 245 | + class TestOutputStream(TestBase): | ||
| 247 | 246 | def __init__(self, max_chunk_size): | |
| 248 | 247 | self.max_chunk_size = max_chunk_size | |
| 249 | 248 | ||
| 250 | 249 | def write(self, b): | |
| 251 | - assert_true(len(b) <= self.max_chunk_size) | ||
| 250 | + self.assertTrue(len(b) <= self.max_chunk_size) | ||
| 252 | 251 | ||
| 253 | 252 | for chunk_size in [16, 128, 1024]: | |
| 254 | 253 | repo.git.status(output_stream=TestOutputStream(chunk_size), max_chunk_size=chunk_size) | |
@@ -404,7 +403,7 @@ def test_should_display_blame_information(self, git): | |||
| 404 | 403 | # self.assertEqual(25, reduce(lambda acc, x: acc + len(x[-1]), b)) | |
| 405 | 404 | self.assertEqual(hash(b[0][0]), hash(b[9][0])) | |
| 406 | 405 | c = b[0][0] | |
| 407 | - assert_true(git.called) | ||
| 406 | + self.assertTrue(git.called) | ||
| 408 | 407 | ||
| 409 | 408 | self.assertEqual('634396b2f541a9f2d58b00be1a07f0c358b999b3', c.hexsha) | |
| 410 | 409 | self.assertEqual('Tom Preston-Werner', c.author.name) | |
@@ -417,9 +416,9 @@ def test_should_display_blame_information(self, git): | |||
| 417 | 416 | ||
| 418 | 417 | # test the 'lines per commit' entries | |
| 419 | 418 | tlist = b[0][1] | |
| 420 | - assert_true(tlist) | ||
| 421 | - assert_true(isinstance(tlist[0], str)) | ||
| 422 | - assert_true(len(tlist) < sum(len(t) for t in tlist)) # test for single-char bug | ||
| 419 | + self.assertTrue(tlist) | ||
| 420 | + self.assertTrue(isinstance(tlist[0], str)) | ||
| 421 | + self.assertTrue(len(tlist) < sum(len(t) for t in tlist)) # test for single-char bug | ||
| 423 | 422 | ||
| 424 | 423 | # BINARY BLAME | |
| 425 | 424 | git.return_value = fixture('blame_binary') | |
| Back | FazBrowse Home | New Git URL |
0 commit comments