mirror of
https://github.com/arsenetar/send2trash.git
synced 2025-05-08 01:39:51 +00:00
Fix tests, add tox.ini and travis.yml
This commit is contained in:
parent
bd9183afe9
commit
b7e3057853
4
.gitignore
vendored
4
.gitignore
vendored
@ -2,4 +2,6 @@
|
|||||||
*.egg-info
|
*.egg-info
|
||||||
/build
|
/build
|
||||||
/dist
|
/dist
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
/.tox
|
||||||
|
__pycache__
|
||||||
|
10
.travis.yml
Normal file
10
.travis.yml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
language: python
|
||||||
|
python:
|
||||||
|
- "2.7"
|
||||||
|
- "3.4"
|
||||||
|
- "3.5"
|
||||||
|
- "3.6"
|
||||||
|
install:
|
||||||
|
- "pip install tox"
|
||||||
|
script:
|
||||||
|
- "tox -e $(echo py$TRAVIS_PYTHON_VERSION | tr -d .)"
|
1
setup.py
1
setup.py
@ -21,6 +21,7 @@ setup(
|
|||||||
author_email='hsoft@hardcoded.net',
|
author_email='hsoft@hardcoded.net',
|
||||||
packages=['send2trash'],
|
packages=['send2trash'],
|
||||||
scripts=[],
|
scripts=[],
|
||||||
|
test_suite='tests',
|
||||||
url='https://github.com/hsoft/send2trash',
|
url='https://github.com/hsoft/send2trash',
|
||||||
license='BSD License',
|
license='BSD License',
|
||||||
description='Send file to trash natively under Mac OS X, Windows and Linux.',
|
description='Send file to trash natively under Mac OS X, Windows and Linux.',
|
||||||
|
0
tests/__init__.py
Normal file
0
tests/__init__.py
Normal file
@ -15,7 +15,7 @@ def touch(path):
|
|||||||
|
|
||||||
class TestHomeTrash(unittest.TestCase):
|
class TestHomeTrash(unittest.TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.file = NamedTemporaryFile(dir=op.expanduser("~"),
|
self.file = NamedTemporaryFile(dir=op.expanduser("~"),
|
||||||
prefix='send2trash_test', delete=False)
|
prefix='send2trash_test', delete=False)
|
||||||
|
|
||||||
def test_trash(self):
|
def test_trash(self):
|
||||||
@ -79,7 +79,7 @@ class TestTopdirTrash(TestExtVol):
|
|||||||
# then it gets renamed etc.)
|
# then it gets renamed etc.)
|
||||||
cfg = ConfigParser()
|
cfg = ConfigParser()
|
||||||
cfg.read(op.join(self.trashDir, str(os.getuid()), 'info', self.fileName + '.trashinfo'))
|
cfg.read(op.join(self.trashDir, str(os.getuid()), 'info', self.fileName + '.trashinfo'))
|
||||||
self.assertEqual(self.fileName, cfg.get('Trash Info', 'Path', 1))
|
self.assertEqual(self.fileName, cfg.get('Trash Info', 'Path', raw=True))
|
||||||
|
|
||||||
# Test .Trash-UID
|
# Test .Trash-UID
|
||||||
class TestTopdirTrashFallback(TestExtVol):
|
class TestTopdirTrashFallback(TestExtVol):
|
||||||
@ -112,7 +112,7 @@ class TestSymlink(TestExtVol):
|
|||||||
# Since is_parent uses realpath(), and our getdev uses is_parent,
|
# Since is_parent uses realpath(), and our getdev uses is_parent,
|
||||||
# this should work
|
# this should work
|
||||||
self.slDir = mktemp(prefix='s2t', dir=op.expanduser('~'))
|
self.slDir = mktemp(prefix='s2t', dir=op.expanduser('~'))
|
||||||
|
|
||||||
os.mkdir(op.join(self.trashTopdir, 'subdir'), 0o700)
|
os.mkdir(op.join(self.trashTopdir, 'subdir'), 0o700)
|
||||||
self.filePath = op.join(self.trashTopdir, 'subdir', self.fileName)
|
self.filePath = op.join(self.trashTopdir, 'subdir', self.fileName)
|
||||||
touch(self.filePath)
|
touch(self.filePath)
|
Loading…
x
Reference in New Issue
Block a user