Exemplo n.º 1
0
    def test_mkdir(self):
        mocked_mkdir = MagicMock()
        mocked_mkdir.return_value = "mk_dir"

        with patch('gitfs.views.passthrough.os.mkdir', mocked_mkdir):
            view = PassthroughView(repo=self.repo, repo_path=self.repo_path)
            result = view.mkdir("/magic/path", "mode")

            assert result == "mk_dir"
            path = '/the/root/path/magic/path'
            mocked_mkdir.assert_called_once_with(path, "mode")
Exemplo n.º 2
0
    def test_mkdir(self):
        mocked_mkdir = MagicMock()
        mocked_mkdir.return_value = "mk_dir"

        with patch('gitfs.views.passthrough.os.mkdir', mocked_mkdir):
            view = PassthroughView(repo=self.repo, repo_path=self.repo_path)
            result = view.mkdir("/magic/path", "mode")

            assert result == "mk_dir"
            path = '/the/root/path/magic/path'
            mocked_mkdir.assert_called_once_with(path, "mode")