Esempio n. 1
0
    def test_handle_ignored_file_type(self):
        """
        Test 'handle_ignored_file_type' raises IgnoredTypeException exception
        only for files with specified extensions.
        """
        sync = Sync(FAKE_MTP_DETAILS, "", "", ignore_file_types=["jpg"])
        sync.set_source_abs()
        sync.set_destination_abs()

        # this one is fine
        sync.handle_ignored_file_type("/tmp/test.png")

        # this one should be ignored
        with self.assertRaises(IgnoredTypeException):
            sync.handle_ignored_file_type("/tmp/test.jpg")