allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [1/2] allura git commit: [#8001] fix assertion typo; add autospec=True params which will help catch such typos
Date Fri, 19 Aug 2016 17:07:20 GMT
Repository: allura
Updated Branches:
  refs/heads/master abbc5661b -> 54447fc65


[#8001] fix assertion typo; add autospec=True params which will help catch such typos


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/54447fc6
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/54447fc6
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/54447fc6

Branch: refs/heads/master
Commit: 54447fc65ce7314f973f359de65377d8e9fc7cc9
Parents: f495847
Author: Dave Brondsema <dave@brondsema.net>
Authored: Thu Aug 18 17:39:07 2016 -0400
Committer: Dave Brondsema <dave@brondsema.net>
Committed: Fri Aug 19 13:07:15 2016 -0400

----------------------------------------------------------------------
 ForgeGit/forgegit/tests/model/test_repository.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/54447fc6/ForgeGit/forgegit/tests/model/test_repository.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/model/test_repository.py b/ForgeGit/forgegit/tests/model/test_repository.py
index 1121637..abf2f0a 100644
--- a/ForgeGit/forgegit/tests/model/test_repository.py
+++ b/ForgeGit/forgegit/tests/model/test_repository.py
@@ -217,7 +217,7 @@ class TestGitRepo(unittest.TestCase, RepoImplTestBase):
         self.assertIn('exec $DIR/post-receive-user\n', c)
         shutil.rmtree(dirname)
 
-    @mock.patch('forgegit.model.git_repo.git.Repo.clone_from')
+    @mock.patch('forgegit.model.git_repo.git.Repo.clone_from', autospec=True)
     def test_hotcopy(self, clone_from):
         with h.push_config(tg.config, **{'scm.git.hotcopy': 'True'}):
             repo = GM.Repository(
@@ -651,15 +651,15 @@ class TestGitRepo(unittest.TestCase, RepoImplTestBase):
             tempfile.mkdtemp.return_value,
             ignore_errors=True)
 
-    @mock.patch('forgegit.model.git_repo.tempfile')
-    @mock.patch('forgegit.model.git_repo.shutil')
-    @mock.patch('forgegit.model.git_repo.git')
+    @mock.patch('forgegit.model.git_repo.tempfile', autospec=True)
+    @mock.patch('forgegit.model.git_repo.shutil', autospec=True)
+    @mock.patch('forgegit.model.git_repo.git', autospec=True)
     def test_merge_raise_exception(self, git, shutil, tempfile):
         self.repo._impl._git.git = mock.Mock()
         git.Repo.clone_from.side_effect = Exception
         with self.assertRaises(Exception):
             self.repo.merge(mock.Mock())
-        shutil.rmtree.assert_has_calles()
+        assert shutil.rmtree.called
 
     @mock.patch.dict('allura.lib.app_globals.config',  {'scm.commit.git.detect_copies': 'false'})
     @td.with_tool('test', 'Git', 'src-weird', 'Git', type='git')


Mime
View raw message