How to use the send2trash.plat_other.send2trash function in Send2Trash

To help you get started, we’ve selected a few Send2Trash examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hsoft / send2trash / tests / test_plat_other.py View on Github external
def test_trash(self):
        s2t(op.join(self.slDir, self.fileName))
        self.assertFalse(op.exists(self.filePath))
        self.assertTrue(op.exists(op.join(self.trashTopdir, '.Trash-' + str(os.getuid()), 'files', self.fileName)))
github hsoft / send2trash / tests / test_plat_other.py View on Github external
def test_trash_bytes(self):
        s2t(self.file)
        assert not op.exists(self.file)
github hsoft / send2trash / tests / test_plat_other.py View on Github external
def test_trash_unicode(self):
        s2t(self.file.decode(sys.getfilesystemencoding()))
        assert not op.exists(self.file)
github hsoft / send2trash / tests / test_plat_other.py View on Github external
def test_trash(self):
        s2t(self.filePath)
        self.assertFalse(op.exists(self.filePath))
        self.assertTrue(op.exists(op.join(self.trashDir, str(os.getuid()), 'files', self.fileName)))
        self.assertTrue(op.exists(op.join(self.trashDir, str(os.getuid()), 'info', self.fileName + '.trashinfo')))
        # info relative path (if another test is added, with the same fileName/Path,
        # then it gets renamed etc.)
        cfg = ConfigParser()
        cfg.read(op.join(self.trashDir, str(os.getuid()), 'info', self.fileName + '.trashinfo'))
        self.assertEqual(self.fileName, cfg.get('Trash Info', 'Path', raw=True))
github hsoft / send2trash / tests / test_plat_other.py View on Github external
def test_trash(self):
        s2t(self.file.name)
        self.assertFalse(op.exists(self.file.name))