Test git.add with a directory
(self)
| 139 | |
| 140 | @pytest.mark.slow_test |
| 141 | def test_add_dir(self): |
| 142 | """ |
| 143 | Test git.add with a directory |
| 144 | """ |
| 145 | newdir = "quux" |
| 146 | # Change to the repo dir |
| 147 | newdir_path = pathlib.Path(self.repo) / newdir |
| 148 | newdir_path.mkdir(parents=True, exist_ok=True) |
| 149 | files = [str(newdir_path / x) for x in self.files] |
| 150 | files_relpath = [os.path.join(newdir, x) for x in self.files] |
| 151 | for path in files: |
| 152 | with salt.utils.files.fopen(path, "wb") as fp_: |
| 153 | fp_.write(f"This is a test file with relative path {path}.\n".encode()) |
| 154 | ret = self.run_function("git.add", [self.repo, newdir]) |
| 155 | res = "\n".join(sorted(f"add '{x}'" for x in files_relpath)) |
| 156 | if salt.utils.platform.is_windows(): |
| 157 | res = res.replace("\\", "/") |
| 158 | self.assertEqual(ret, res) |
| 159 | |
| 160 | @pytest.mark.slow_test |
| 161 | def test_add_file(self): |
nothing calls this directly
no test coverage detected