예제 #1
0
    def test_05(self):
        """
        Test Case 05:
        Test :py:meth:`magrathea.utils.file.File._check_access` with an existing, but forbidden path.

        Test is passed if return value is False.
        """
        self.assertFalse(File._check_access('/usr/sbin', os.W_OK))
예제 #2
0
    def test_06(self):
        """
        Test Case 06:
        Test :py:meth:`magrathea.utils.file.File._check_file_exists` with an existing file (this file).

        Test is passed if return value is True.
        """
        self.assertTrue(File._check_file_exists(__file__))
예제 #3
0
    def test_03(self):
        """
        Test Case 03:
        Test :py:meth:`magrathea.utils.file.File._check_access` with an existing path (this file).

        Test is passed if return value is True.
        """
        self.assertTrue(File._check_access(__file__, os.R_OK))
예제 #4
0
    def test_04(self):
        """
        Test Case 04:
        Test :py:meth:`magrathea.utils.file.File._check_access` with a non existing path.

        Test is passed if return value is False.
        """
        self.assertFalse(File._check_access('/foobarstuffdirdoesntexist', os.R_OK))
예제 #5
0
    def test_11(self):
        """
        Test Case 11:
        Test :py:meth:`magrathea.utils.file.File._check_dir_exists` with an existing fs object not being a directory.

        Test is passed if return value is False.
        """
        self.assertFalse(File._check_dir_exists(__file__))
예제 #6
0
    def test_10(self):
        """
        Test Case 10:
        Test :py:meth:`magrathea.utils.file.File._check_dir_exists` with a non-existing directory.

        Test is passed if return value is False.
        """
        self.assertFalse(File._check_dir_exists('/foobarstuffdirdoesntexist'))
예제 #7
0
    def test_09(self):
        """
        Test Case 09:
        Test :py:meth:`magrathea.utils.file.File._check_dir_exists` with an existing directory (this file's parent).

        Test is passed if return value is True.
        """
        self.assertTrue(File._check_dir_exists(os.path.dirname(__file__)))
예제 #8
0
    def test_08(self):
        """
        Test Case 08:
        Test :py:meth:`magrathea.utils.file.File._check_file_exists` with an existing fs object not being a file.

        Test is passed if return value is False.
        """
        self.assertFalse(File._check_file_exists('/usr/sbin'))
예제 #9
0
    def test_07(self):
        """
        Test Case 07:
        Test :py:meth:`magrathea.utils.file.File._check_file_exists` with a non-existing file.

        Test is passed if return value is True.
        """
        self.assertFalse(File._check_file_exists('/foobarstuffdirdoesntexist'))