diff --git a/tests/test_add.py b/tests/test_add.py index 0acf3194d..59894b40a 100644 --- a/tests/test_add.py +++ b/tests/test_add.py @@ -6,6 +6,7 @@ import filecmp from dvc.main import main from dvc.utils import file_md5 from dvc.stage import Stage +from dvc.exceptions import DvcException from dvc.output.base import OutputAlreadyTrackedError from dvc.output.base import OutputDoesNotExistError, OutputIsNotFileOrDirError from dvc.command.add import CmdAdd @@ -27,10 +28,10 @@ class TestAdd(TestDvc): self.assertEqual(stage.outs[0].info['md5'], md5) -class TestAddNonExistentFile(TestDvc): +class TestAddUnupportedFile(TestDvc): def test(self): - with self.assertRaises(OutputDoesNotExistError) as cx: - self.dvc.add('non_existent_file') + with self.assertRaises(DvcException) as cx: + self.dvc.add('unsupported://unsupported') class TestAddDirectory(TestDvc): diff --git a/tests/test_import.py b/tests/test_import.py index f1f3630d2..fc75f536e 100644 --- a/tests/test_import.py +++ b/tests/test_import.py @@ -5,6 +5,7 @@ import filecmp from dvc.main import main from dvc.command.imp import CmdImport +from dvc.exceptions import DvcException from tests.basic_env import TestDvc @@ -18,3 +19,7 @@ class TestCmdImport(TestDvc): ret = main(['import', 'non-existing-file', 'import']) self.assertNotEqual(ret, 0) + + def test_unsupported(self): + ret = main(['import', 'unsupported://path', 'import_unsupported']) + self.assertNotEqual(ret, 0) diff --git a/tests/test_remote.py b/tests/test_remote.py index 1045d93ad..31884b8ee 100644 --- a/tests/test_remote.py +++ b/tests/test_remote.py @@ -40,4 +40,4 @@ class TestRemote(TestDvc): def test_unsupported(self): with self.assertRaises(UnsupportedRemoteError): - Remote(self.dvc, {Config.SECTION_REMOTE_URL: 'unsupported://url') + Remote(self.dvc, {Config.SECTION_REMOTE_URL: 'unsupported://url'})