# HG changeset patch # User RhodeCode Admin # Date 2023-08-25 12:47:04 # Node ID 3cdc843a4e3d819169bbf9a3004ab1546a1aa453 # Parent 1fa672f51b7243ba35338af2b99afde290105e3b tests: fixed some git tests for lfs modules diff --git a/rhodecode/tests/vcs/test_git.py b/rhodecode/tests/vcs/test_git.py --- a/rhodecode/tests/vcs/test_git.py +++ b/rhodecode/tests/vcs/test_git.py @@ -1201,9 +1201,10 @@ class TestGetSubmoduleUrl(object): def test_submodules_file_found(self): commit = GitCommit(repository=mock.Mock(), raw_id='abcdef12', idx=1) node = mock.Mock() + with mock.patch.object( commit, 'get_node', return_value=node) as get_node_mock: - node.content = ( + node.str_content = ( '[submodule "subrepo1"]\n' '\tpath = subrepo1\n' '\turl = https://code.rhodecode.com/dulwich\n' @@ -1215,9 +1216,10 @@ class TestGetSubmoduleUrl(object): def test_complex_submodule_path(self): commit = GitCommit(repository=mock.Mock(), raw_id='abcdef12', idx=1) node = mock.Mock() + with mock.patch.object( commit, 'get_node', return_value=node) as get_node_mock: - node.content = ( + node.str_content = ( '[submodule "complex/subrepo/path"]\n' '\tpath = complex/subrepo/path\n' '\turl = https://code.rhodecode.com/dulwich\n' @@ -1236,9 +1238,10 @@ class TestGetSubmoduleUrl(object): def test_path_not_found(self): commit = GitCommit(repository=mock.Mock(), raw_id='abcdef12', idx=1) node = mock.Mock() + with mock.patch.object( commit, 'get_node', return_value=node) as get_node_mock: - node.content = ( + node.str_content = ( '[submodule "subrepo1"]\n' '\tpath = subrepo1\n' '\turl = https://code.rhodecode.com/dulwich\n' @@ -1250,9 +1253,10 @@ class TestGetSubmoduleUrl(object): def test_returns_cached_values(self): commit = GitCommit(repository=mock.Mock(), raw_id='abcdef12', idx=1) node = mock.Mock() + with mock.patch.object( commit, 'get_node', return_value=node) as get_node_mock: - node.content = ( + node.str_content = ( '[submodule "subrepo1"]\n' '\tpath = subrepo1\n' '\turl = https://code.rhodecode.com/dulwich\n'