cp.get_file
(self, tgt)
| 84 | @with_tempfile() |
| 85 | @pytest.mark.slow_test |
| 86 | def test_get_file_gzipped(self, tgt): |
| 87 | """ |
| 88 | cp.get_file |
| 89 | """ |
| 90 | src = os.path.join(RUNTIME_VARS.FILES, "file", "base", "file.big") |
| 91 | with salt.utils.files.fopen(src, "rb") as fp_: |
| 92 | hash_str = hashlib.sha256(fp_.read()).hexdigest() |
| 93 | |
| 94 | self.run_function("cp.get_file", ["salt://file.big", tgt], gzip=5) |
| 95 | with salt.utils.files.fopen(tgt, "rb") as scene: |
| 96 | data = scene.read() |
| 97 | self.assertEqual(hash_str, hashlib.sha256(data).hexdigest()) |
| 98 | data = salt.utils.stringutils.to_unicode(data) |
| 99 | self.assertIn("KNIGHT: They're nervous, sire.", data) |
| 100 | self.assertNotIn("bacon", data) |
| 101 | |
| 102 | @pytest.mark.slow_test |
| 103 | def test_get_file_makedirs(self): |
nothing calls this directly
no test coverage detected