From 49dead0474c84dddc114caabf5bc99c8fe01c8a6 Mon Sep 17 00:00:00 2001 From: Zhanibek Date: Wed, 27 Mar 2019 14:50:53 +0600 Subject: [PATCH] tests: add CmdDiff command line parsing test --- tests/test_diff.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/test_diff.py b/tests/test_diff.py index 935697c0b..8e823b815 100644 --- a/tests/test_diff.py +++ b/tests/test_diff.py @@ -1,5 +1,7 @@ from __future__ import unicode_literals + import os +from mock import patch from dvc.main import main @@ -41,8 +43,11 @@ class TestDiffRepo(TestDiff): class TestDiffCmdLine(TestDiff): def test(self): - ret = main(["diff", self.new_file, str(self.a_ref)]) - self.assertEqual(ret, 0) + with patch("dvc.repo.Repo", config="testing") as MockRepo: + MockRepo.return_value.diff.return_value = "testing" + MockRepo.return_value.diff.return_value = "testing" + ret = main(["diff", "-t", self.new_file, str(self.a_ref)]) + self.assertEqual(ret, 0) class TestDiffDir(TestDvc):