Exemplo n.º 1
0
    def test_rename(self):
        mocked_rename = MagicMock()
        mocked_rename.return_value = "magic"

        with patch('gitfs.views.passthrough.os.rename', mocked_rename):
            view = PassthroughView(repo=self.repo, repo_path=self.repo_path)
            result = view.rename("/magic/path", "/magic/new")

            assert result == "magic"
            old = '/the/root/path/magic/path'
            new = '/the/root/path/magic/new'
            mocked_rename.has_calls([call(old), call(new)])
Exemplo n.º 2
0
    def test_rename(self):
        mocked_rename = MagicMock()
        mocked_rename.return_value = "magic"

        with patch('gitfs.views.passthrough.os.rename', mocked_rename):
            view = PassthroughView(repo=self.repo, repo_path=self.repo_path)
            result = view.rename("/magic/path", "/magic/new")

            assert result == "magic"
            old = '/the/root/path/magic/path'
            new = '/the/root/path/magic/new'
            mocked_rename.has_calls([call(old), call(new)])