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


Python Repo.path方法代码示例

本文整理汇总了Python中chacra.models.Repo.path方法的典型用法代码示例。如果您正苦于以下问题:Python Repo.path方法的具体用法?Python Repo.path怎么用?Python Repo.path使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在chacra.models.Repo的用法示例。


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

示例1: test_multiple_distros_with_built_repos

# 需要导入模块: from chacra.models import Repo [as 别名]
# 或者: from chacra.models.Repo import path [as 别名]
 def test_multiple_distros_with_built_repos(self, session):
     p = Project('foobar')
     repo = Repo(
         p,
         "firefly",
         "ubuntu",
         "trusty",
     )
     repo2 = Repo(
         p,
         "firefly",
         "centos",
         "7",
     )
     repo.path = "some_path"
     repo2.path = "some_path"
     session.commit()
     result = session.app.get('/repos/foobar/firefly/')
     assert result.status_int == 200
     assert len(result.json) == 2
     assert result.json == {"ubuntu": ["trusty"], "centos": ['7']}
开发者ID:ahills,项目名称:chacra,代码行数:23,代码来源:test_refs.py

示例2: test_do_not_show_refs_without_built_repos

# 需要导入模块: from chacra.models import Repo [as 别名]
# 或者: from chacra.models.Repo import path [as 别名]
 def test_do_not_show_refs_without_built_repos(self, session):
     p = Project('foobar')
     repo = Repo(
         p,
         "firefly",
         "ubuntu",
         "trusty",
     )
     repo2 = Repo(
         p,
         "hammer",
         "ubuntu",
         "trusty",
     )
     repo.path = "some_path"
     repo2.path = "some_path"
     session.commit()
     result = session.app.get('/repos/foobar/')
     assert result.status_int == 200
     assert len(result.json) == 2
     assert result.json == {"firefly": ["ubuntu"], "hammer": ["ubuntu"]}
开发者ID:ahills,项目名称:chacra,代码行数:23,代码来源:test_projects.py

示例3: test_shows_only_versions_for_ref

# 需要导入模块: from chacra.models import Repo [as 别名]
# 或者: from chacra.models.Repo import path [as 别名]
 def test_shows_only_versions_for_ref(self, session):
     p = Project('foobar')
     repo = Repo(
         p,
         "firefly",
         "ubuntu",
         "trusty",
     )
     repo.path = "some_path"
     repo2 = Repo(
         p,
         "hammer",
         "ubuntu",
         "precise",
     )
     repo2.path = "some_path"
     session.commit()
     result = session.app.get('/repos/foobar/firefly/ubuntu/')
     assert result.status_int == 200
     assert len(result.json) == 1
     assert result.json == ["trusty"]
开发者ID:ahills,项目名称:chacra,代码行数:23,代码来源:test_distros.py

示例4: test_does_not_show_duplicate_distro_versions

# 需要导入模块: from chacra.models import Repo [as 别名]
# 或者: from chacra.models.Repo import path [as 别名]
 def test_does_not_show_duplicate_distro_versions(self, session):
     p = Project('foobar')
     repo = Repo(
         p,
         "firefly",
         "ubuntu",
         "trusty",
     )
     repo.path = "some_path"
     repo2 = Repo(
         p,
         "firefly",
         "ubuntu",
         "trusty",
     )
     repo2.path = "some_path"
     session.commit()
     result = session.app.get('/repos/foobar/firefly/ubuntu/')
     assert result.status_int == 200
     assert len(result.json) == 1
     assert result.json == ["trusty"]
开发者ID:ahills,项目名称:chacra,代码行数:23,代码来源:test_distros.py

示例5: test_ref_does_not_exist

# 需要导入模块: from chacra.models import Repo [as 别名]
# 或者: from chacra.models.Repo import path [as 别名]
 def test_ref_does_not_exist(self, session):
     p = Project('foobar')
     repo = Repo(
         p,
         "firefly",
         "ubuntu",
         "trusty",
     )
     repo.path = "some_path"
     session.commit()
     result = session.app.get('/repos/foobar/hammer/ubuntu/trusty/', expect_errors=True)
     assert result.status_int == 404
开发者ID:ahills,项目名称:chacra,代码行数:14,代码来源:test_repos.py

示例6: test_default_flavor

# 需要导入模块: from chacra.models import Repo [as 别名]
# 或者: from chacra.models.Repo import path [as 别名]
 def test_default_flavor(self, session):
     p = Project('foobar')
     repo = Repo(
         p,
         "firefly",
         "ubuntu",
         "trusty",
         sha1="head",
     )
     repo.path = "some_path"
     session.commit()
     result = session.app.get('/repos/foobar/firefly/head/ubuntu/trusty/flavors/')
     assert result.json == ['default']
开发者ID:ceph,项目名称:chacra,代码行数:15,代码来源:test_flavors.py

示例7: test_sha1_does_not_exist

# 需要导入模块: from chacra.models import Repo [as 别名]
# 或者: from chacra.models.Repo import path [as 别名]
 def test_sha1_does_not_exist(self, session, url):
     p = Project('foobar')
     repo = Repo(
         p,
         "firefly",
         "ubuntu",
         "trusty",
         sha1="head",
     )
     repo.path = "some_path"
     session.commit()
     result = session.app.get(url, expect_errors=True)
     assert result.status_int == 404
开发者ID:ceph,项目名称:chacra,代码行数:15,代码来源:test_repos.py

示例8: test_extra_metadata_default

# 需要导入模块: from chacra.models import Repo [as 别名]
# 或者: from chacra.models.Repo import path [as 别名]
 def test_extra_metadata_default(self, session, url):
     p = Project('foobar')
     repo = Repo(
         p,
         "firefly",
         "ubuntu",
         "trusty",
         sha1="head",
     )
     repo.path = "some_path"
     session.commit()
     result = session.app.get(url)
     assert result.json['extra'] == {}
开发者ID:ceph,项目名称:chacra,代码行数:15,代码来源:test_repos.py

示例9: test_multiple_flavors

# 需要导入模块: from chacra.models import Repo [as 别名]
# 或者: from chacra.models.Repo import path [as 别名]
 def test_multiple_flavors(self, session):
     p = Project('foobar')
     repo = Repo(
         p,
         "firefly",
         "ubuntu",
         "trusty",
         sha1="head",
     )
     repo.path = "some_path"
     repo = Repo(
         p,
         "firefly",
         "ubuntu",
         "trusty",
         sha1="head",
         flavor="tcmalloc",
     )
     repo.path = "some_path"
     session.commit()
     result = session.app.get('/repos/foobar/firefly/head/ubuntu/trusty/flavors/')
     assert sorted(result.json) == sorted(['default', 'tcmalloc'])
开发者ID:ceph,项目名称:chacra,代码行数:24,代码来源:test_flavors.py

示例10: test_recreate_head

# 需要导入模块: from chacra.models import Repo [as 别名]
# 或者: from chacra.models.Repo import path [as 别名]
 def test_recreate_head(self, session, tmpdir, url):
     p = Project('foobar')
     repo = Repo(
         p,
         "firefly",
         "ubuntu",
         "trusty",
         sha1="head",
     )
     repo.path = "some_path"
     session.commit()
     result = session.app.head(url)
     assert result.status_int == 200
开发者ID:ceph,项目名称:chacra,代码行数:15,代码来源:test_repos.py

示例11: test_recreate_head

# 需要导入模块: from chacra.models import Repo [as 别名]
# 或者: from chacra.models.Repo import path [as 别名]
 def test_recreate_head(self, session, tmpdir):
     p = Project('foobar')
     repo = Repo(
         p,
         "firefly",
         "ubuntu",
         "trusty",
     )
     repo.path = "some_path"
     session.commit()
     result = session.app.head(
         "/repos/foobar/firefly/ubuntu/trusty/recreate"
     )
     assert result.status_int == 200
开发者ID:ahills,项目名称:chacra,代码行数:16,代码来源:test_repos.py

示例12: test_repo_type

# 需要导入模块: from chacra.models import Repo [as 别名]
# 或者: from chacra.models.Repo import path [as 别名]
 def test_repo_type(self, session, url):
     p = Project('foobar')
     repo = Repo(
         p,
         "firefly",
         "ubuntu",
         "trusty",
         sha1="head",
     )
     repo.path = "some_path"
     session.commit()
     result = session.app.get(url)
     assert result.status_int == 200
     assert result.json["type"] is None
开发者ID:ceph,项目名称:chacra,代码行数:16,代码来源:test_repos.py

示例13: test_single_project_with_built_repos

# 需要导入模块: from chacra.models import Repo [as 别名]
# 或者: from chacra.models.Repo import path [as 别名]
 def test_single_project_with_built_repos(self, session):
     p = Project('foobar')
     repo = Repo(
         p,
         "firefly",
         "ubuntu",
         "trusty",
     )
     repo.path = "some_path"
     session.commit()
     result = session.app.get('/repos/')
     assert result.status_int == 200
     assert len(result.json) == 1
     assert result.json == {"foobar": ["firefly"]}
开发者ID:ceph,项目名称:chacra,代码行数:16,代码来源:test_projects.py

示例14: test_repo_exists

# 需要导入模块: from chacra.models import Repo [as 别名]
# 或者: from chacra.models.Repo import path [as 别名]
 def test_repo_exists(self, session):
     p = Project('foobar')
     repo = Repo(
         p,
         "firefly",
         "ubuntu",
         "trusty",
     )
     repo.path = "some_path"
     session.commit()
     result = session.app.get('/repos/foobar/firefly/ubuntu/trusty/')
     assert result.status_int == 200
     assert result.json["distro_version"] == "trusty"
     assert result.json["distro"] == "ubuntu"
     assert result.json["ref"] == "firefly"
开发者ID:ahills,项目名称:chacra,代码行数:17,代码来源:test_repos.py

示例15: test_get_single_project

# 需要导入模块: from chacra.models import Repo [as 别名]
# 或者: from chacra.models.Repo import path [as 别名]
 def test_get_single_project(self, session):
     p = Project('foobar')
     repo = Repo(
         p,
         "firefly",
         "ubuntu",
         "trusty",
         sha1="head",
     )
     repo.path = "some_path"
     session.commit()
     result = session.app.get('/repos/foobar/firefly/head/')
     assert result.status_int == 200
     assert len(result.json) == 1
     assert result.json == {"ubuntu": ["trusty"]}
开发者ID:ceph,项目名称:chacra,代码行数:17,代码来源:test_sha1s.py


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