From acae1b996fb0cf2bb31aa4b18743d38761a987b0 Mon Sep 17 00:00:00 2001 From: "Mr. Outis" Date: Tue, 30 Oct 2018 19:32:08 -0600 Subject: [PATCH] scm: Add dir property to Base class (#1281) Close #1279 --- dvc/scm.py | 4 ++++ tests/test_repro.py | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/dvc/scm.py b/dvc/scm.py index 5230d00a0..e49039721 100644 --- a/dvc/scm.py +++ b/dvc/scm.py @@ -18,6 +18,10 @@ class Base(object): self.project = project self.root_dir = root_dir + @property + def dir(self): + return None + @staticmethod def is_repo(root_dir): return True diff --git a/tests/test_repro.py b/tests/test_repro.py index 70db0abdc..112386088 100644 --- a/tests/test_repro.py +++ b/tests/test_repro.py @@ -763,3 +763,9 @@ class TestReproShell(TestDvc): with open(fname, 'r') as fd: self.assertEqual(os.getenv('SHELL'), fd.read().strip()) + +class TestReproNoSCM(TestRepro): + def test(self): + shutil.rmtree(self.dvc.scm.dir) + ret = main(['repro', self.file1_stage]) + self.assertEqual(ret, 0)