diff options
author | Alejandro Gallo <aamsgallo@gmail.com> | 2018-03-17 15:46:34 +0100 |
---|---|---|
committer | Alejandro Gallo <aamsgallo@gmail.com> | 2018-03-17 15:46:34 +0100 |
commit | e5e5f08cd0db51fb905dfb71bf47e1cca138e122 (patch) | |
tree | b5bc505e3c05c8264e1f185a563621d8adfb636e | |
parent | 4bbd900091fe60adcfb33ac58be7c44ff7359e18 (diff) |
Clean up add tests
-rw-r--r-- | papis/tests/test_add.py | 12 | ||||
-rw-r--r-- | papis/tests/test_addremove.py | 26 |
2 files changed, 11 insertions, 27 deletions
diff --git a/papis/tests/test_add.py b/papis/tests/test_add.py index bfafd81d..2f5bece5 100644 --- a/papis/tests/test_add.py +++ b/papis/tests/test_add.py @@ -3,7 +3,7 @@ import tempfile import unittest import papis.tests import papis.config -from papis.commands.add import run +from papis.commands.add import run, get_document_extension class Test(unittest.TestCase): @@ -87,3 +87,13 @@ class Test(unittest.TestCase): doc = docs[0] self.assertTrue(doc is not None) self.assertTrue(len(doc.get_files()) == 1) + + def test_extension(self): + docs = [ + ["blahblah.pdf", "pdf"], + ["b.lahblah.pdf", "pdf"], + ["no/extension/blahblah", "txt"], + ["a/asdfsdf21/blahblah.epub", "epub"], + ] + for d in docs: + self.assertTrue(get_document_extension(d[0]) == d[1]) diff --git a/papis/tests/test_addremove.py b/papis/tests/test_addremove.py index 17964715..7152bde0 100644 --- a/papis/tests/test_addremove.py +++ b/papis/tests/test_addremove.py @@ -79,17 +79,6 @@ class TestAdd(CommandTest): t.join() self.assertFalse(t.isAlive()) - def test_extension(self): - docs = [ - ["blahblah.pdf", "pdf"], - ["b.lahblah.pdf", "pdf"], - ["no/extension/blahblah", "txt"], - ["a/asdfsdf21/blahblah.epub", "epub"], - ] - for d in docs: - self.assertTrue( - self.command.get_document_extension(d[0]) == d[1] - ) # def test_add_file(self): # args = ("add", @@ -125,21 +114,6 @@ class TestAdd(CommandTest): # # FIXME: check output folder and file! # self.assertTrue(output == status.success) - def test_add_missing(self): - args = ("add", - os.path.join(os.path.dirname(__file__), - "resources", - "example_document_missing.txt")) - output = papis.commands.main(args) - - self.assertTrue(output == status.file_not_found) - - def test_remove_missing(self): - args = ("rm", "-f", - "example_document_missing.txt") - output = papis.commands.main(args) - self.assertTrue(output != status.success) - # def test_add_file_with_dir(self): # args = ("add", "--dir", "subdir", # os.path.join(os.path.dirname(__file__), |