| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -118,5 +118,16 @@ def test_add_unicode(self, rw_repo): | |||
| 118 | 118 | file_path = os.path.join(rw_repo.working_dir, filename) | |
| 119 | 119 | open(file_path, "wb").write(b'something') | |
| 120 | 120 | ||
| 121 | - rw_repo.git.add(rw_repo.working_dir) | ||
| 121 | + | ||
| 122 | + if os.name == 'nt': | ||
| 123 | + # on windows, there is no way this works, see images on | ||
| 124 | + # https://github.com/gitpython-developers/GitPython/issues/147#issuecomment-68881897 | ||
| 125 | + # Therefore, it must be added using the python implementation | ||
| 126 | + rw_repo.index.add([file_path]) | ||
| 127 | + # However, when the test winds down, rmtree fails to delete this file, which is recognized | ||
| 128 | + # as ??? only. | ||
| 129 | + else: | ||
| 130 | + # on posix, we can just add unicode files without problems | ||
| 131 | + rw_repo.git.add(rw_repo.working_dir) | ||
| 132 | + # end | ||
| 122 | 133 | rw_repo.index.commit('message') | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -121,11 +121,16 @@ def test_version(self): | |||
| 121 | 121 | ||
| 122 | 122 | def test_cmd_override(self): | |
| 123 | 123 | prev_cmd = self.git.GIT_PYTHON_GIT_EXECUTABLE | |
| 124 | + if os.name == 'nt': | ||
| 125 | + exc = GitCommandError | ||
| 126 | + else: | ||
| 127 | + exc = OSError | ||
| 128 | + # end handle windows case | ||
| 124 | 129 | try: | |
| 125 | 130 | # set it to something that doens't exist, assure it raises | |
| 126 | 131 | type(self.git).GIT_PYTHON_GIT_EXECUTABLE = os.path.join( | |
| 127 | 132 | "some", "path", "which", "doesn't", "exist", "gitbinary") | |
| 128 | - self.failUnlessRaises(OSError, self.git.version) | ||
| 133 | + self.failUnlessRaises(exc, self.git.version) | ||
| 129 | 134 | finally: | |
| 130 | 135 | type(self.git).GIT_PYTHON_GIT_EXECUTABLE = prev_cmd | |
| 131 | 136 | # END undo adjustment | |
| Back | FazBrowse Home | New Git URL |
0 commit comments