| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent feed81e commit aba0494
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -58,19 +58,16 @@ def _init_externals(): | |||
| 58 | 58 | __all__ = [name for name, obj in locals().items() | |
| 59 | 59 | if not (name.startswith('_') or inspect.ismodule(obj))] | |
| 60 | 60 | ||
| 61 | + | ||
| 61 | 62 | #{ Initialize git executable path | |
| 62 | - def setup(path=None): | ||
| 63 | + def refresh(path=None): | ||
| 63 | 64 | """Convenience method for setting the git executable path.""" | |
| 64 | 65 | if not Git.refresh(path=path): | |
| 65 | 66 | return | |
| 66 | 67 | if not FetchInfo.refresh(): | |
| 67 | 68 | return | |
| 68 | - | ||
| 69 | - def refresh(path=None): | ||
| 70 | - """Convenience method for refreshing the git executable path.""" | ||
| 71 | - setup(path=path) | ||
| 72 | 69 | #} END initialize git executable path | |
| 73 | 70 | ||
| 74 | 71 | ################# | |
| 75 | - setup() | ||
| 72 | + refresh() | ||
| 76 | 73 | ################# | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -10,6 +10,7 @@ | |||
| 10 | 10 | ||
| 11 | 11 | from git import ( | |
| 12 | 12 | Git, | |
| 13 | + refresh, | ||
| 13 | 14 | GitCommandError, | |
| 14 | 15 | GitCommandNotFound, | |
| 15 | 16 | Repo, | |
@@ -156,6 +157,14 @@ def test_cmd_override(self): | |||
| 156 | 157 | type(self.git).GIT_PYTHON_GIT_EXECUTABLE = prev_cmd | |
| 157 | 158 | # END undo adjustment | |
| 158 | 159 | ||
| 160 | + def test_refresh(self): | ||
| 161 | + # test a bad git path refresh | ||
| 162 | + self.assertRaises(GitCommandNotFound, refresh, "yada") | ||
| 163 | + | ||
| 164 | + # test a good path refresh | ||
| 165 | + path = os.popen("which git").read().strip() | ||
| 166 | + refresh(path) | ||
| 167 | + | ||
| 159 | 168 | def test_options_are_passed_to_git(self): | |
| 160 | 169 | # This work because any command after git --version is ignored | |
| 161 | 170 | git_version = self.git(version=True).NoOp() | |
| Back | FazBrowse Home | New Git URL |
0 commit comments