当前位置: 首页>>代码示例>>Python>>正文


Python config.GitosisRawConfigParser类代码示例

本文整理汇总了Python中gitosis.config.GitosisRawConfigParser的典型用法代码示例。如果您正苦于以下问题:Python GitosisRawConfigParser类的具体用法?Python GitosisRawConfigParser怎么用?Python GitosisRawConfigParser使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了GitosisRawConfigParser类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_owner_full_access

def test_owner_full_access():
    cfg = GitosisRawConfigParser()
    cfg.add_section("repo foo/bar")
    cfg.set("repo foo/bar", "owner", "jdoe")

    assert access.allowed(cfg,
        user="jdoe", mode="writable", path="foo/bar") == ("repositories", "foo/bar")

    assert access.allowed(cfg,
        user="jdoe", mode="readable", path="foo/bar") == ("repositories", "foo/bar")
开发者ID:superbobry,项目名称:gitosis,代码行数:10,代码来源:test_access.py

示例2: test_base_local

def test_base_local():
    cfg = GitosisRawConfigParser()
    cfg.add_section("group fooers")
    cfg.set("group fooers", "repositories", "some/relative/path")
    cfg.set("group fooers", "members", "jdoe")
    cfg.set("group fooers", "map writable foo/bar", "baz/quux/thud")

    assert access.allowed(cfg,
        user="jdoe", mode="writable", path="foo/bar") == ("some/relative/path", "baz/quux/thud")
开发者ID:superbobry,项目名称:gitosis,代码行数:9,代码来源:test_access.py

示例3: test_base_global_unset

def test_base_global_unset():
    cfg = GitosisRawConfigParser()
    cfg.add_section("gitosis")
    cfg.add_section("group fooers")
    cfg.set("group fooers", "members", "jdoe")
    cfg.set("group fooers", "readonly", "foo xyzzy bar")

    assert access.allowed(cfg,
        user="jdoe", mode="readonly", path="xyzzy") == ("repositories", "xyzzy")
开发者ID:superbobry,项目名称:gitosis,代码行数:9,代码来源:test_access.py

示例4: test_write_no_simple_with_readonly

def test_write_no_simple_with_readonly():
    cfg = GitosisRawConfigParser()
    cfg.add_section("group fooers")
    cfg.set("group fooers", "members", "jdoe")
    cfg.set("group fooers", "readonly", "foo/bar")

    assert access.allowed(cfg,
        user="jdoe", mode="writable", path="foo/bar") is None
开发者ID:superbobry,项目名称:gitosis,代码行数:8,代码来源:test_access.py

示例5: test_write_yes_map

def test_write_yes_map():
    cfg = GitosisRawConfigParser()
    cfg.add_section("group fooers")
    cfg.set("group fooers", "members", "jdoe")
    cfg.set("group fooers", "map writable foo/bar", "quux/thud")

    assert access.allowed(config=cfg,
        user="jdoe", mode="writable", path="foo/bar") == ("repositories", "quux/thud")
开发者ID:superbobry,项目名称:gitosis,代码行数:8,代码来源:test_access.py

示例6: test_read_yes_map_with_writable

def test_read_yes_map_with_writable():
    cfg = GitosisRawConfigParser()
    cfg.add_section("group fooers")
    cfg.set("group fooers", "members", "jdoe")
    cfg.set("group fooers", "map writable foo/bar", "quux/thud")

    assert access.allowed(cfg,
        user="jdoe", mode="readonly", path="foo/bar") is None
开发者ID:superbobry,项目名称:gitosis,代码行数:8,代码来源:test_access.py

示例7: test_read_yes_all

def test_read_yes_all():
    cfg = GitosisRawConfigParser()
    cfg.add_section("group fooers")
    cfg.set("group fooers", "members", "@all")
    cfg.set("group fooers", "readonly", "foo/bar")

    assert access.allowed(cfg,
        user="jdoe", mode="readonly", path="foo/bar") == ("repositories", "foo/bar")
开发者ID:superbobry,项目名称:gitosis,代码行数:8,代码来源:test_access.py

示例8: test_dotgit

def test_dotgit():
    # a .git extension is always allowed to be added
    cfg = GitosisRawConfigParser()
    cfg.add_section("group fooers")
    cfg.set("group fooers", "members", "jdoe")
    cfg.set("group fooers", "writable", "foo/bar")

    assert access.allowed(cfg,
        user="jdoe", mode="writable", path="foo/bar.git") == ("repositories", "foo/bar")
开发者ID:superbobry,项目名称:gitosis,代码行数:9,代码来源:test_access.py

示例9: test_no_notListed

def test_no_notListed():
    cfg = RawConfigParser()
    cfg.add_section('group hackers')
    cfg.set('group hackers', 'members', 'wsmith')
    gen = group.getMembership(config=cfg, user='jdoe')
    eq(gen.next(), 'all')
    assert_raises(StopIteration, gen.next)
开发者ID:superbobry,项目名称:gitosis,代码行数:7,代码来源:test_group.py

示例10: test_projectsList_repoDenied

def test_projectsList_repoDenied():
    cfg = RawConfigParser()
    cfg.add_section("repo foo/bar")
    got = StringIO()
    gitweb.generate_project_list_fp(config=cfg, fp=got)
    eq(
        got.getvalue(),
        """\
""",
    )
开发者ID:superbobry,项目名称:gitosis,代码行数:10,代码来源:test_gitweb.py

示例11: test_projectsList_noOwner

def test_projectsList_noOwner():
    cfg = RawConfigParser()
    cfg.add_section("repo foo/bar")
    cfg.set("repo foo/bar", "gitweb", "yes")
    got = StringIO()
    gitweb.generate_project_list_fp(config=cfg, fp=got)
    eq(
        got.getvalue(),
        """\
foo%2Fbar
""",
    )
开发者ID:superbobry,项目名称:gitosis,代码行数:12,代码来源:test_gitweb.py

示例12: test_no_recurse_loop

def test_no_recurse_loop():
    cfg = RawConfigParser()
    cfg.add_section('group hackers')
    cfg.set('group hackers', 'members', '@smackers')
    cfg.add_section('group smackers')
    cfg.set('group smackers', 'members', '@hackers')
    gen = group.getMembership(config=cfg, user='jdoe')
    eq(gen.next(), 'all')
    assert_raises(StopIteration, gen.next)
开发者ID:superbobry,项目名称:gitosis,代码行数:9,代码来源:test_group.py

示例13: test_yes_recurse_one_ordering

def test_yes_recurse_one_ordering():
    cfg = RawConfigParser()
    cfg.add_section('group smackers')
    cfg.set('group smackers', 'members', 'danny jdoe')
    cfg.add_section('group hackers')
    cfg.set('group hackers', 'members', 'wsmith @smackers')
    gen = group.getMembership(config=cfg, user='jdoe')
    eq(gen.next(), 'smackers')
    eq(gen.next(), 'hackers')
    eq(gen.next(), 'all')
    assert_raises(StopIteration, gen.next)
开发者ID:superbobry,项目名称:gitosis,代码行数:11,代码来源:test_group.py

示例14: test_description_repo_missing_parent

def test_description_repo_missing_parent():
    # configured but not created yet; before first push
    tmp = maketemp()
    path = os.path.join(tmp, "foo/bar.git")
    cfg = RawConfigParser()
    cfg.add_section("gitosis")
    cfg.set("gitosis", "repositories", tmp)
    cfg.add_section("repo foo")
    cfg.set("repo foo", "description", "foodesc")
    gitweb.set_descriptions(config=cfg)
    assert not os.path.exists(os.path.join(tmp, "foo"))
开发者ID:superbobry,项目名称:gitosis,代码行数:11,代码来源:test_gitweb.py

示例15: test_bad_forbiddenCommand_write_readAccess_space

def test_bad_forbiddenCommand_write_readAccess_space():
    cfg = RawConfigParser()
    cfg.add_section('group foo')
    cfg.set('group foo', 'members', 'jdoe')
    cfg.set('group foo', 'readonly', 'foo')
    e = assert_raises(
        serve.WriteAccessDenied,
        serve.serve,
        cfg=cfg,
        user='jdoe',
        command="git receive-pack 'foo'",
        )
    eq(str(e), 'Repository write access denied')
    assert isinstance(e, serve.AccessDenied)
    assert isinstance(e, serve.ServingError)
开发者ID:superbobry,项目名称:gitosis,代码行数:15,代码来源:test_serve.py


注:本文中的gitosis.config.GitosisRawConfigParser类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。