本文整理汇总了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']}
示例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"]}
示例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"]
示例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"]
示例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
示例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']
示例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
示例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'] == {}
示例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'])
示例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
示例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
示例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
示例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"]}
示例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"
示例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"]}