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

Method setUp

tests/integration/modules/test_linux_acl.py:24–41  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

22 """
23
24 def setUp(self):
25 # Blindly copied from tests.integration.modules.file; Refactoring?
26 self.myfile = os.path.join(RUNTIME_VARS.TMP, "myfile")
27 with salt.utils.files.fopen(self.myfile, "w+") as fp:
28 fp.write("Hello\n")
29 self.mydir = os.path.join(RUNTIME_VARS.TMP, "mydir/isawesome")
30 if not os.path.isdir(self.mydir):
31 # left behind... Don't fail because of this!
32 os.makedirs(self.mydir)
33 self.mysymlink = os.path.join(RUNTIME_VARS.TMP, "mysymlink")
34 if os.path.islink(self.mysymlink):
35 os.remove(self.mysymlink)
36 os.symlink(self.myfile, self.mysymlink)
37 self.mybadsymlink = os.path.join(RUNTIME_VARS.TMP, "mybadsymlink")
38 if os.path.islink(self.mybadsymlink):
39 os.remove(self.mybadsymlink)
40 os.symlink("/nonexistentpath", self.mybadsymlink)
41 super().setUp()
42
43 def tearDown(self):
44 if os.path.isfile(self.myfile):

Callers

nothing calls this directly

Calls 2

writeMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected