mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-09 23:10:24 +01:00
@@ -7,3 +7,4 @@ exclude_lines =
|
||||
if __name__ == .__main__.:
|
||||
pass
|
||||
raise NotImplementedError
|
||||
# pragma: no cover
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ def _fix_subparsers(subparsers):
|
||||
# More info at:
|
||||
# https://bugs.python.org/issue16308
|
||||
# https://github.com/iterative/dvc/issues/769
|
||||
if sys.version_info[0] == 3:
|
||||
if sys.version_info[0] == 3: # pragma: no cover
|
||||
subparsers.required = True
|
||||
subparsers.dest = 'cmd'
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ from dvc.remote.local import RemoteLOCAL
|
||||
|
||||
|
||||
class DependencyLOCAL(DependencyBase):
|
||||
REGEX = r'^(?P<path>(/+|.:\\+)?.*)$'
|
||||
REGEX = r'^(?P<path>(/+|.:\\+)?[^:]*)$'
|
||||
|
||||
DoesNotExistError = DependencyDoesNotExistError
|
||||
IsNotFileOrDirError = DependencyIsNotFileOrDirError
|
||||
|
||||
@@ -17,10 +17,6 @@ class Lock(object):
|
||||
self.lock_file = os.path.join(dvc_dir, name)
|
||||
self._lock = None
|
||||
|
||||
@staticmethod
|
||||
def init(dvc_dir):
|
||||
return Lock(dvc_dir)
|
||||
|
||||
def _do_lock(self):
|
||||
try:
|
||||
self._lock = zc.lockfile.LockFile(self.lock_file)
|
||||
|
||||
+1
-1
@@ -62,7 +62,7 @@ class Logger(object):
|
||||
header = ''
|
||||
footer = ''
|
||||
|
||||
if sys.stdout.isatty():
|
||||
if sys.stdout.isatty(): # pragma: no cover
|
||||
header = Logger.COLOR_MAP.get(typ.lower(), '')
|
||||
footer = colorama.Style.RESET_ALL
|
||||
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
from dvc.dependency import _get
|
||||
from dvc.exceptions import DvcException
|
||||
|
||||
from tests.basic_env import TestDvc
|
||||
|
||||
|
||||
class TestUnsupported(TestDvc):
|
||||
def test(self):
|
||||
with self.assertRaises(DvcException):
|
||||
_get(None, 'unsupported://a/b', None)
|
||||
@@ -110,6 +110,9 @@ class TestMetricsReproCLI(TestDvc):
|
||||
ret = main(['metrics', 'add', 'metrics'])
|
||||
self.assertEqual(ret, 0)
|
||||
|
||||
ret = main(['metrics', 'modify', '-t', 'csv', '-x', '0,0', 'metrics'])
|
||||
self.assertEqual(ret, 0)
|
||||
|
||||
ret = main(['repro', '-f', '-m', stage.path])
|
||||
self.assertEqual(ret, 0)
|
||||
|
||||
@@ -195,6 +198,9 @@ class TestMetricsCLI(TestMetrics):
|
||||
ret = main(['metrics', 'add', 'non-existing'])
|
||||
self.assertNotEqual(ret, 0)
|
||||
|
||||
ret = main(['metrics', 'modify', 'non-existing'])
|
||||
self.assertNotEqual(ret, 0)
|
||||
|
||||
ret = main(['metrics', 'remove', 'non-existing'])
|
||||
self.assertNotEqual(ret, 0)
|
||||
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
from dvc.output import _get
|
||||
from dvc.exceptions import DvcException
|
||||
|
||||
from tests.basic_env import TestDvc
|
||||
|
||||
|
||||
class TestUnsupported(TestDvc):
|
||||
def test(self):
|
||||
with self.assertRaises(DvcException):
|
||||
_get(None, 'unsupported://a/b', None, None, None)
|
||||
+3
-1
@@ -245,8 +245,10 @@ class TestReproMissingMd5InStageFile(TestRepro):
|
||||
self.assertEqual(len(stages), 1)
|
||||
|
||||
|
||||
class TestCmdRepro(TestRepro):
|
||||
class TestCmdRepro(TestReproChangedData):
|
||||
def test(self):
|
||||
self.swap_foo_with_bar()
|
||||
|
||||
ret = main(['status'])
|
||||
self.assertEqual(ret, 0)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user