| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,28 +8,28 @@ environment: | |||
| 8 | 8 | - PYTHON: "C:\\Python27" | |
| 9 | 9 | PYTHON_VERSION: "2.7" | |
| 10 | 10 | GIT_PATH: "%GIT_DAEMON_PATH%" | |
| 11 | - - PYTHON: "C:\\Miniconda" | ||
| 11 | + - PYTHON: "C:\\Miniconda-x64" | ||
| 12 | 12 | PYTHON_VERSION: "2.7" | |
| 13 | 13 | IS_CONDA: "yes" | |
| 14 | 14 | GIT_PATH: "%CYGWIN_GIT_PATH%" | |
| 15 | 15 | ||
| 16 | 16 | - PYTHON: "C:\\Python34-x64" | |
| 17 | 17 | PYTHON_VERSION: "3.4" | |
| 18 | - GIT_PATH: "%CYGWIN64_GIT_PATH%" | ||
| 18 | + GIT_PATH: "%GIT_DAEMON_PATH%" | ||
| 19 | 19 | - PYTHON: "C:\\Python34-x64" | |
| 20 | 20 | PYTHON_VERSION: "3.4" | |
| 21 | 21 | GIT_PATH: "%CYGWIN_GIT_PATH%" | |
| 22 | - - PYTHON: "C:\\Miniconda3-x64" | ||
| 23 | - PYTHON_VERSION: "3.4" | ||
| 24 | - IS_CONDA: "yes" | ||
| 25 | - GIT_PATH: "%GIT_DAEMON_PATH%" | ||
| 26 | 22 | ||
| 27 | 23 | - PYTHON: "C:\\Python35-x64" | |
| 28 | 24 | PYTHON_VERSION: "3.5" | |
| 29 | 25 | GIT_PATH: "%GIT_DAEMON_PATH%" | |
| 30 | 26 | - PYTHON: "C:\\Python35-x64" | |
| 31 | 27 | PYTHON_VERSION: "3.5" | |
| 32 | 28 | GIT_PATH: "%CYGWIN64_GIT_PATH%" | |
| 29 | + - PYTHON: "C:\\Miniconda35-x64" | ||
| 30 | + PYTHON_VERSION: "3.5" | ||
| 31 | + IS_CONDA: "yes" | ||
| 32 | + GIT_PATH: "%GIT_DAEMON_PATH%" | ||
| 33 | 33 | ||
| 34 | 34 | install: | |
| 35 | 35 | - set PATH=%PYTHON%;%PYTHON%\Scripts;%GIT_PATH%;%PATH% | |
@@ -44,9 +44,9 @@ install: | |||
| 44 | 44 | ||
| 45 | 45 | - IF "%IS_CONDA%"=="yes" ( | |
| 46 | 46 | conda info -a & | |
| 47 | - conda install --yes --quiet pip smmap | ||
| 47 | + conda install --yes --quiet pip | ||
| 48 | 48 | ) | |
| 49 | - - pip install nose wheel coveralls | ||
| 49 | + - pip install nose ddt wheel coveralls | ||
| 50 | 50 | - IF "%PYTHON_VERSION%"=="2.7" ( | |
| 51 | 51 | pip install mock | |
| 52 | 52 | ) | |
@@ -68,7 +68,7 @@ install: | |||
| 68 | 68 | git config --global user.email "travis@ci.com" | |
| 69 | 69 | git config --global user.name "Travis Runner" | |
| 70 | 70 | ||
| 71 | - - python setup.py develop | ||
| 71 | + - pip install -e . | ||
| 72 | 72 | ||
| 73 | 73 | build: false | |
| 74 | 74 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -16,7 +16,7 @@ git: | |||
| 16 | 16 | install: | |
| 17 | 17 | - git submodule update --init --recursive | |
| 18 | 18 | - git fetch --tags | |
| 19 | - - pip install coveralls flake8 sphinx | ||
| 19 | + - pip install coveralls flake8 ddt sphinx | ||
| 20 | 20 | ||
| 21 | 21 | # generate some reflog as git-python tests need it (in master) | |
| 22 | 22 | - ./init-tests-after-clone.sh | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -24,8 +24,10 @@ | |||
| 24 | 24 | DiffIndex, | |
| 25 | 25 | NULL_TREE, | |
| 26 | 26 | ) | |
| 27 | + import ddt | ||
| 27 | 28 | ||
| 28 | 29 | ||
| 30 | + @ddt.ddt | ||
| 29 | 31 | class TestDiff(TestBase): | |
| 30 | 32 | ||
| 31 | 33 | def tearDown(self): | |
@@ -118,18 +120,20 @@ def test_diff_of_modified_files_not_added_to_the_index(self): | |||
| 118 | 120 | self.assertEqual(diffs[0].change_type, 'M') | |
| 119 | 121 | self.assertIsNone(diffs[0].b_blob,) | |
| 120 | 122 | ||
| 121 | - def test_binary_diff(self): | ||
| 122 | - for method, file_name in ((Diff._index_from_patch_format, 'diff_patch_binary'), | ||
| 123 | - (Diff._index_from_raw_format, 'diff_raw_binary')): | ||
| 124 | - res = method(None, StringProcessAdapter(fixture(file_name)).stdout) | ||
| 125 | - self.assertEqual(len(res), 1) | ||
| 126 | - self.assertEqual(len(list(res.iter_change_type('M'))), 1) | ||
| 127 | - if res[0].diff: | ||
| 128 | - self.assertEqual(res[0].diff, | ||
| 129 | - b"Binary files a/rps and b/rps differ\n", | ||
| 130 | - "in patch mode, we get a diff text") | ||
| 131 | - self.assertIsNotNone(str(res[0]), "This call should just work") | ||
| 132 | - # end for each method to test | ||
| 123 | + @ddt.data( | ||
| 124 | + (Diff._index_from_patch_format, 'diff_patch_binary'), | ||
| 125 | + (Diff._index_from_raw_format, 'diff_raw_binary') | ||
| 126 | + ) | ||
| 127 | + def test_binary_diff(self, case): | ||
| 128 | + method, file_name = case | ||
| 129 | + res = method(None, StringProcessAdapter(fixture(file_name)).stdout) | ||
| 130 | + self.assertEqual(len(res), 1) | ||
| 131 | + self.assertEqual(len(list(res.iter_change_type('M'))), 1) | ||
| 132 | + if res[0].diff: | ||
| 133 | + self.assertEqual(res[0].diff, | ||
| 134 | + b"Binary files a/rps and b/rps differ\n", | ||
| 135 | + "in patch mode, we get a diff text") | ||
| 136 | + self.assertIsNotNone(str(res[0]), "This call should just work") | ||
| 133 | 137 | ||
| 134 | 138 | def test_diff_index(self): | |
| 135 | 139 | output = StringProcessAdapter(fixture('diff_index_patch')) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -68,7 +68,7 @@ def _stamp_version(filename): | |||
| 68 | 68 | print("WARNING: Couldn't find version line in file %s" % filename, file=sys.stderr) | |
| 69 | 69 | ||
| 70 | 70 | install_requires = ['gitdb >= 0.6.4'] | |
| 71 | - test_requires = ['node'] | ||
| 71 | + test_requires = ['node', 'ddt'] | ||
| 72 | 72 | if sys.version_info[:2] < (2, 7): | |
| 73 | 73 | install_requires.append('ordereddict') | |
| 74 | 74 | test_requires.append('mock') | |
| Back | FazBrowse Home | New Git URL |
0 commit comments