MCPcopy Index your code
hub / github.com/saltstack/salt / test_add_file

Method test_add_file

tests/integration/modules/test_git.py:161–174  ·  view source on GitHub ↗

Test git.add with a file

(self)

Source from the content-addressed store, hash-verified

159
160 @pytest.mark.slow_test
161 def test_add_file(self):
162 """
163 Test git.add with a file
164 """
165 filename = "quux"
166 file_path = os.path.join(self.repo, filename)
167 with salt.utils.files.fopen(file_path, "w") as fp_:
168 fp_.write(
169 salt.utils.stringutils.to_str(
170 f"This is a test file named {filename}.\n"
171 )
172 )
173 ret = self.run_function("git.add", [self.repo, filename])
174 self.assertEqual(ret, f"add '{filename}'")
175
176 @pytest.mark.slow_test
177 def test_archive(self):

Callers

nothing calls this directly

Calls 2

run_functionMethod · 0.95
writeMethod · 0.45

Tested by

no test coverage detected