Example #1
0
    def test_args(self):
        mocked_parser = MagicMock()
        mocked_args = MagicMock()

        mocked_args.return_value = "args"

        with patch.multiple('gitfs.mounter', Args=mocked_args):
            assert parse_args(mocked_parser) == "args"
            asserted_calls = [call('remote_url', help='repo to be cloned'),
                              call('mount_point',
                                   help='where the repo should be mount'),
                              call('-o', help='other options: repo_path, ' +
                                   'user, group, branch, max_size, ' +
                                   'max_offset, fetch_timeout, merge_timeout')]
            mocked_parser.add_argument.has_calls(asserted_calls)
Example #2
0
    def test_args(self):
        mocked_parser = MagicMock()
        mocked_args = MagicMock()

        mocked_args.return_value = "args"

        with patch.multiple("gitfs.mounter", Args=mocked_args):
            assert parse_args(mocked_parser) == "args"
            asserted_calls = [
                call("remote_url", help="repo to be cloned"),
                call("mount_point", help="where the repo should be mount"),
                call(
                    "-o",
                    help="other options: repo_path, " +
                    "user, group, branch, max_size, " +
                    "max_offset, fetch_timeout, merge_timeout",
                ),
            ]
            mocked_parser.add_argument.has_calls(asserted_calls)