mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-16 07:18:25 +01:00
test: test unsupported chemes
Signed-off-by: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
+4
-3
@@ -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,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)
|
||||
|
||||
@@ -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'})
|
||||
|
||||
Reference in New Issue
Block a user