From 81c8ed9da5a2104becadf03a85aa6657a11c490b Mon Sep 17 00:00:00 2001 From: alex maslakoff Date: Fri, 2 Aug 2019 16:09:10 +0300 Subject: [PATCH] add a test for 'dir changes' --- tests/func/test_diff.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/func/test_diff.py b/tests/func/test_diff.py index 4c8ec3fab..dca648f85 100644 --- a/tests/func/test_diff.py +++ b/tests/func/test_diff.py @@ -226,3 +226,20 @@ class TestDiffModifiedFile(TestDiff): ], } self.assertEqual(test_dct, result) + + +class TestDiffModifiedFileMessage(TestDiffModifiedFile): + def test(self): + test_dct = { + diff.DIFF_IDENT: 0, + diff.DIFF_CHANGE: 1, + diff.DIFF_NEW: 0, + diff.DIFF_DEL: 0, + diff.DIFF_SIZE: self.diff_len, + } + + msg = CmdDiff._get_dir_changes(test_dct) + test_msg = "0 files untouched, 1 file modified, 0 files added, " + test_msg += "0 files deleted, size was increased by {} Bytes" + test_msg = test_msg.format(self.diff_len) + self.assertEqual(test_msg, msg)