| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -336,7 +336,7 @@ class TestBase(TestCase): | |||
| 336 | 336 | - Class level repository which is considered read-only as it is shared among | |
| 337 | 337 | all test cases in your type. | |
| 338 | 338 | Access it using:: | |
| 339 | - self.rorepo # 'ro' stands for read-only | ||
| 339 | + self.rorepo # 'ro' stands for read-only | ||
| 340 | 340 | ||
| 341 | 341 | The rorepo is in fact your current project's git repo. If you refer to specific | |
| 342 | 342 | shas for your objects, be sure you choose some that are part of the immutable portion | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -9,7 +9,7 @@ | |||
| 9 | 9 | import tempfile | |
| 10 | 10 | from unittest import SkipTest, skipIf | |
| 11 | 11 | ||
| 12 | - from git import ( | ||
| 12 | + from git.objects import ( | ||
| 13 | 13 | Blob, | |
| 14 | 14 | Tree, | |
| 15 | 15 | Commit, | |
@@ -18,17 +18,17 @@ | |||
| 18 | 18 | from git.compat import is_win | |
| 19 | 19 | from git.objects.util import get_object_type_by_name | |
| 20 | 20 | from test.lib import ( | |
| 21 | - TestBase, | ||
| 21 | + TestBase as _TestBase, | ||
| 22 | 22 | with_rw_repo, | |
| 23 | 23 | with_rw_and_rw_remote_repo | |
| 24 | 24 | ) | |
| 25 | - from git.util import hex_to_bin | ||
| 25 | + from git.util import hex_to_bin, HIDE_WINDOWS_FREEZE_ERRORS | ||
| 26 | 26 | ||
| 27 | 27 | import git.objects.base as base | |
| 28 | 28 | import os.path as osp | |
| 29 | 29 | ||
| 30 | 30 | ||
| 31 | - class TestBase(TestBase): | ||
| 31 | + class TestBase(_TestBase): | ||
| 32 | 32 | ||
| 33 | 33 | def tearDown(self): | |
| 34 | 34 | import gc | |
@@ -111,15 +111,13 @@ def test_with_rw_repo(self, rw_repo): | |||
| 111 | 111 | assert not rw_repo.config_reader("repository").getboolean("core", "bare") | |
| 112 | 112 | assert osp.isdir(osp.join(rw_repo.working_tree_dir, 'lib')) | |
| 113 | 113 | ||
| 114 | - #@skipIf(HIDE_WINDOWS_FREEZE_ERRORS, "FIXME: Freezes! sometimes...") | ||
| 114 | + @skipIf(HIDE_WINDOWS_FREEZE_ERRORS, "FIXME: Freezes! sometimes...") | ||
| 115 | 115 | @with_rw_and_rw_remote_repo('0.1.6') | |
| 116 | 116 | def test_with_rw_remote_and_rw_repo(self, rw_repo, rw_remote_repo): | |
| 117 | 117 | assert not rw_repo.config_reader("repository").getboolean("core", "bare") | |
| 118 | 118 | assert rw_remote_repo.config_reader("repository").getboolean("core", "bare") | |
| 119 | 119 | assert osp.isdir(osp.join(rw_repo.working_tree_dir, 'lib')) | |
| 120 | 120 | ||
| 121 | - @skipIf(sys.version_info < (3,) and is_win, | ||
| 122 | - "Unicode woes, see https://github.com/gitpython-developers/GitPython/pull/519") | ||
| 123 | 121 | @with_rw_repo('0.1.6') | |
| 124 | 122 | def test_add_unicode(self, rw_repo): | |
| 125 | 123 | filename = "שלום.txt" | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -265,7 +265,7 @@ def test_rev_list_bisect_all(self): | |||
| 265 | 265 | @with_rw_directory | |
| 266 | 266 | def test_ambiguous_arg_iteration(self, rw_dir): | |
| 267 | 267 | rw_repo = Repo.init(osp.join(rw_dir, 'test_ambiguous_arg')) | |
| 268 | - path = osp.join(rw_repo.working_tree_dir, 'master') | ||
| 268 | + path = osp.join(str(rw_repo.working_tree_dir), 'master') | ||
| 269 | 269 | touch(path) | |
| 270 | 270 | rw_repo.index.add([path]) | |
| 271 | 271 | rw_repo.index.commit('initial commit') | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -18,7 +18,6 @@ | |||
| 18 | 18 | Repo, | |
| 19 | 19 | cmd | |
| 20 | 20 | ) | |
| 21 | - from git.compat import is_darwin | ||
| 22 | 21 | from test.lib import ( | |
| 23 | 22 | TestBase, | |
| 24 | 23 | fixture_path | |
@@ -248,11 +247,7 @@ def test_environment(self, rw_dir): | |||
| 248 | 247 | try: | |
| 249 | 248 | remote.fetch() | |
| 250 | 249 | except GitCommandError as err: | |
| 251 | - if sys.version_info[0] < 3 and is_darwin: | ||
| 252 | - self.assertIn('ssh-orig', str(err)) | ||
| 253 | - self.assertEqual(err.status, 128) | ||
| 254 | - else: | ||
| 255 | - self.assertIn('FOO', str(err)) | ||
| 250 | + self.assertIn('FOO', str(err)) | ||
| 256 | 251 | ||
| 257 | 252 | def test_handle_process_output(self): | |
| 258 | 253 | from git.cmd import handle_process_output | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -119,14 +119,14 @@ def test_heads(self, rwrepo): | |||
| 119 | 119 | assert head.tracking_branch() == remote_ref | |
| 120 | 120 | head.set_tracking_branch(None) | |
| 121 | 121 | assert head.tracking_branch() is None | |
| 122 | - | ||
| 122 | + | ||
| 123 | 123 | special_name = 'feature#123' | |
| 124 | 124 | special_name_remote_ref = SymbolicReference.create(rwrepo, 'refs/remotes/origin/%s' % special_name) | |
| 125 | 125 | gp_tracking_branch = rwrepo.create_head('gp_tracking#123') | |
| 126 | 126 | special_name_remote_ref = rwrepo.remotes[0].refs[special_name] # get correct type | |
| 127 | 127 | gp_tracking_branch.set_tracking_branch(special_name_remote_ref) | |
| 128 | 128 | assert gp_tracking_branch.tracking_branch().path == special_name_remote_ref.path | |
| 129 | - | ||
| 129 | + | ||
| 130 | 130 | git_tracking_branch = rwrepo.create_head('git_tracking#123') | |
| 131 | 131 | rwrepo.git.branch('-u', special_name_remote_ref.name, git_tracking_branch.name) | |
| 132 | 132 | assert git_tracking_branch.tracking_branch().name == special_name_remote_ref.name | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -347,15 +347,15 @@ def _assert_push_and_pull(self, remote, rw_repo, remote_repo): | |||
| 347 | 347 | progress = TestRemoteProgress() | |
| 348 | 348 | to_be_updated = "my_tag.1.0RV" | |
| 349 | 349 | new_tag = TagReference.create(rw_repo, to_be_updated) # @UnusedVariable | |
| 350 | - other_tag = TagReference.create(rw_repo, "my_obj_tag.2.1aRV", message="my message") | ||
| 350 | + other_tag = TagReference.create(rw_repo, "my_obj_tag.2.1aRV", logmsg="my message") | ||
| 351 | 351 | res = remote.push(progress=progress, tags=True) | |
| 352 | 352 | self.assertTrue(res[-1].flags & PushInfo.NEW_TAG) | |
| 353 | 353 | progress.make_assertion() | |
| 354 | 354 | self._do_test_push_result(res, remote) | |
| 355 | 355 | ||
| 356 | 356 | # update push new tags | |
| 357 | 357 | # Rejection is default | |
| 358 | - new_tag = TagReference.create(rw_repo, to_be_updated, ref='HEAD~1', force=True) | ||
| 358 | + new_tag = TagReference.create(rw_repo, to_be_updated, reference='HEAD~1', force=True) | ||
| 359 | 359 | res = remote.push(tags=True) | |
| 360 | 360 | self._do_test_push_result(res, remote) | |
| 361 | 361 | self.assertTrue(res[-1].flags & PushInfo.REJECTED) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3,7 +3,6 @@ | |||
| 3 | 3 | # the BSD License: http://www.opensource.org/licenses/bsd-license.php | |
| 4 | 4 | import os | |
| 5 | 5 | import shutil | |
| 6 | - import sys | ||
| 7 | 6 | from unittest import skipIf | |
| 8 | 7 | ||
| 9 | 8 | import git | |
@@ -421,7 +420,7 @@ def test_base_rw(self, rwrepo): | |||
| 421 | 420 | def test_base_bare(self, rwrepo): | |
| 422 | 421 | self._do_base_tests(rwrepo) | |
| 423 | 422 | ||
| 424 | - @skipIf(HIDE_WINDOWS_KNOWN_ERRORS and sys.version_info[:2] == (3, 5), """ | ||
| 423 | + @skipIf(HIDE_WINDOWS_KNOWN_ERRORS, """ | ||
| 425 | 424 | File "C:\\projects\\gitpython\\git\\cmd.py", line 559, in execute | |
| 426 | 425 | raise GitCommandNotFound(command, err) | |
| 427 | 426 | git.exc.GitCommandNotFound: Cmd('git') not found due to: OSError('[WinError 6] The handle is invalid') | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,7 +5,6 @@ | |||
| 5 | 5 | # the BSD License: http://www.opensource.org/licenses/bsd-license.php | |
| 6 | 6 | ||
| 7 | 7 | from io import BytesIO | |
| 8 | - import sys | ||
| 9 | 8 | from unittest import skipIf | |
| 10 | 9 | ||
| 11 | 10 | from git.objects import ( | |
@@ -20,7 +19,7 @@ | |||
| 20 | 19 | ||
| 21 | 20 | class TestTree(TestBase): | |
| 22 | 21 | ||
| 23 | - @skipIf(HIDE_WINDOWS_KNOWN_ERRORS and sys.version_info[:2] == (3, 5), """ | ||
| 22 | + @skipIf(HIDE_WINDOWS_KNOWN_ERRORS, """ | ||
| 24 | 23 | File "C:\\projects\\gitpython\\git\\cmd.py", line 559, in execute | |
| 25 | 24 | raise GitCommandNotFound(command, err) | |
| 26 | 25 | git.exc.GitCommandNotFound: Cmd('git') not found due to: OSError('[WinError 6] The handle is invalid') | |
@@ -53,7 +52,7 @@ def test_serializable(self): | |||
| 53 | 52 | testtree._deserialize(stream) | |
| 54 | 53 | # END for each item in tree | |
| 55 | 54 | ||
| 56 | - @skipIf(HIDE_WINDOWS_KNOWN_ERRORS and sys.version_info[:2] == (3, 5), """ | ||
| 55 | + @skipIf(HIDE_WINDOWS_KNOWN_ERRORS, """ | ||
| 57 | 56 | File "C:\\projects\\gitpython\\git\\cmd.py", line 559, in execute | |
| 58 | 57 | raise GitCommandNotFound(command, err) | |
| 59 | 58 | git.exc.GitCommandNotFound: Cmd('git') not found due to: OSError('[WinError 6] The handle is invalid') | |
| Back | FazBrowse Home | New Git URL |
0 commit comments