Example #1
0
 def test_dir_exists_returns_False_if_missing_with_sudo(self,
                                                        *args,
                                                        **kwargs):
     self.assertFalse(
         os_helpers.dir_exists(location='/tmp/level1/level2',
                               use_sudo=False)
     )
Example #2
0
 def test_dir_exists_returns_True_with_sudo(self, *args, **kwargs):
     # make sure we have a level2 folder only accessible by root
     sudo('mkdir -p /tmp/level1/level2')
     sudo('chmod 700 /tmp/level1')
     self.assertTrue(
         os_helpers.dir_exists(location='/tmp/level1/level2',
                               use_sudo=True))
Example #3
0
 def test_dir_exists_returns_True(self, *args, **kwargs):
     # make sure we have a /tmp/temp1 folder
     sudo('mkdir /tmp/temp1')
     self.assertTrue(
         os_helpers.dir_exists(location='/tmp/temp1',
                               use_sudo=False)
     )
Example #4
0
 def test_dir_exists_returns_True_with_sudo(self, *args, **kwargs):
     # make sure we have a level2 folder only accessible by root
     sudo('mkdir -p /tmp/level1/level2')
     sudo('chmod 700 /tmp/level1')
     self.assertTrue(
         os_helpers.dir_exists(location='/tmp/level1/level2',
                               use_sudo=True)
     )
Example #5
0
 def test_dir_exists_returns_False_if_missing_with_sudo(
         self, *args, **kwargs):
     self.assertFalse(
         os_helpers.dir_exists(location='/tmp/level1/level2',
                               use_sudo=False))
Example #6
0
 def test_dir_exists_returns_False_if_missing(self, *args, **kwargs):
     self.assertFalse(
         os_helpers.dir_exists(location='/tmp/temp1', use_sudo=False))
Example #7
0
 def test_dir_exists_returns_True(self, *args, **kwargs):
     # make sure we have a /tmp/temp1 folder
     sudo('mkdir /tmp/temp1')
     self.assertTrue(
         os_helpers.dir_exists(location='/tmp/temp1', use_sudo=False))
Example #8
0
 def test_dir_exists_returns_False_if_missing(self, *args, **kwargs):
     self.assertFalse(
         os_helpers.dir_exists(location='/tmp/temp1',
                               use_sudo=False)
     )