Exemple #1
0
    def test_03(self):
        """
        Test Case 03:
        Try setting :py:meth:`magrathea.core.template.Template.path` to an existing, non-writable path.

        Test is passed if :py:meth:`magrathea.core.template.Template.path` points to its previous value.
        """
        obj = Template()
        name = obj.path
        obj.path = '/usr/sbin'
        self.assertEqual(obj.path, name)
Exemple #2
0
    def test_04(self):
        """
        Test Case 04:
        Try setting :py:meth:`magrathea.core.template.Template.path` to a non-existing path.

        Test is passed if :py:meth:`magrathea.core.template.Template.path` points to its previous value.
        """
        obj = Template()
        name = obj.path
        obj.path = '/foobarstuffdirdoesntexist'
        self.assertEqual(obj.path, name)
Exemple #3
0
    def test_02(self):
        """
        Test Case 02:
        Try setting :py:meth:`magrathea.core.template.Template.path` to an existing, writable path.

        Test is passed if :py:meth:`magrathea.core.template.Template.path` points to this path.
        """
        name = tempfile.mkdtemp()
        obj = Template()
        obj.path = name
        self.assertEqual(name, obj.path)
        shutil.rmtree(name)