MCPcopy Create free account
hub / github.com/saltstack/salt / test_cache_local_file

Method test_cache_local_file

tests/integration/modules/test_cp.py:412–421  ·  view source on GitHub ↗

cp.cache_local_file

(self)

Source from the content-addressed store, hash-verified

410
411 @pytest.mark.slow_test
412 def test_cache_local_file(self):
413 """
414 cp.cache_local_file
415 """
416 src = os.path.join(RUNTIME_VARS.TMP, "random")
417 with salt.utils.files.fopen(src, "w+") as fn_:
418 fn_.write(salt.utils.stringutils.to_str("foo"))
419 ret = self.run_function("cp.cache_local_file", [src])
420 with salt.utils.files.fopen(ret, "r") as cp_:
421 self.assertEqual(salt.utils.stringutils.to_unicode(cp_.read()), "foo")
422
423 @pytest.mark.skip_if_binaries_missing("nginx")
424 @pytest.mark.slow_test

Callers

nothing calls this directly

Calls 3

run_functionMethod · 0.95
writeMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected