test: test unsupported chemes

Signed-off-by: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
Ruslan Kuprieiev
2018-07-19 23:05:41 +03:00
parent 07fa6442b8
commit 6a6a4fe0b4
3 changed files with 10 additions and 4 deletions
+4 -3
View File
@@ -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):
+5
View File
@@ -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)
+1 -1
View File
@@ -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'})