Exemplo n.º 1
0
    def test_destination_directory_does_not_exist(self):
        """
        Should raise an execption.
        :return:
        """
        from artefact.localhost.file import FileCopy

        file_ = FileCopy(parameters={}, parent=None)
        with self.assertRaises(FileNotFoundError):
            file_.destination_directory = "./doesNotExist/"
Exemplo n.º 2
0
    def test_destination_directory_is_file(self):
        """
        Should raise an exception.
        :return:
        """
        from artefact.localhost.file import FileCopy
        from businesslogic.errors import CollectorParameterError

        file_ = FileCopy(parameters={}, parent=None)
        with self.assertRaises(CollectorParameterError):
            file_.destination_directory = "./testfiles/test.txt"
Exemplo n.º 3
0
    def test_destination_directory_exists(self):
        """
        Should set the property _destination_directory
        :return:
        """
        from artefact.localhost.file import FileCopy

        expected = './copydestination/'
        file_ = FileCopy(parameters={}, parent=None)
        file_.destination_directory = expected
        actual = file_._destination_directory

        self.assertEqual(expected, actual)