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


Python models.Repo类代码示例

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


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

示例1: test_ref_does_not_exist

 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,代码行数:12,代码来源:test_repos.py

示例2: test_sha1_does_not_exist

 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,代码行数:13,代码来源:test_repos.py

示例3: test_recreate_head

 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,代码行数:13,代码来源:test_repos.py

示例4: test_default_flavor

 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,代码行数:13,代码来源:test_flavors.py

示例5: test_extra_metadata_default

 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,代码行数:13,代码来源:test_repos.py

示例6: test_recreate_head

 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,代码行数:14,代码来源:test_repos.py

示例7: test_single_project_with_built_repos

 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,代码行数:14,代码来源:test_projects.py

示例8: test_binary_file_deleted_removes_repo

 def test_binary_file_deleted_removes_repo(self, session, tmpdir):
     # if a repo has no binaries related to it after binary deletion, it is deleted as well
     pecan.conf.binary_root = str(tmpdir)
     session.app.post(
         '/binaries/ceph/giant/ceph/el6/x86_64/',
         params={'force': 1},
         upload_files=[('file', 'ceph-9.0.0-0.el6.x86_64.rpm', 'hello tharrrr')]
     )
     repo = Repo.get(1)
     assert repo
     result = session.app.delete('/binaries/ceph/giant/ceph/el6/x86_64/ceph-9.0.0-0.el6.x86_64.rpm/')
     assert result.status_int == 204
     repo = Repo.get(1)
     assert not repo
开发者ID:ahills,项目名称:chacra,代码行数:14,代码来源:test_binaries.py

示例9: test_single_distro

 def test_single_distro(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/')
     assert result.status_int == 200
     assert len(result.json) == 1
     assert result.json == ["trusty"]
开发者ID:GregMeno,项目名称:chacra,代码行数:14,代码来源:test_distros.py

示例10: test_repo_type

 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,代码行数:14,代码来源:test_repos.py

示例11: test_repo_exists

 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,代码行数:15,代码来源:test_repos.py

示例12: test_recreate_invalid_path

 def test_recreate_invalid_path(self, session, tmpdir, url):
     path = str(tmpdir)
     invalid_path = os.path.join(path, 'invalid_path')
     p = Project('foobar')
     repo = Repo(
         p,
         "firefly",
         "ubuntu",
         "trusty",
         sha1="head",
     )
     repo.path = invalid_path
     session.commit()
     result = session.app.post_json(url)
     assert os.path.exists(path) is True
     assert result.json['needs_update'] is True
开发者ID:ceph,项目名称:chacra,代码行数:16,代码来源:test_repos.py

示例13: test_recreate

 def test_recreate(self, session, tmpdir, url):
     path = str(tmpdir)
     p = Project('foobar')
     repo = Repo(
         p,
         "firefly",
         "ubuntu",
         "trusty",
         sha1="head",
     )
     repo.path = path
     session.commit()
     result = session.app.post_json(url, params={})
     assert os.path.exists(path) is False
     assert result.json['needs_update'] is True
     assert result.json['is_queued'] is False
开发者ID:ceph,项目名称:chacra,代码行数:16,代码来源:test_repos.py

示例14: test_update_empty_json

 def test_update_empty_json(self, session):
     p = Project('foobar')
     repo = Repo(
         p,
         "firefly",
         "ubuntu",
         "trusty",
     )
     repo.path = "some_path"
     session.commit()
     result = session.app.post_json(
         "/repos/foobar/firefly/ubuntu/trusty/",
         params=dict(),
         expect_errors=True,
     )
     assert result.status_int == 400
开发者ID:ahills,项目名称:chacra,代码行数:16,代码来源:test_repos.py

示例15: test_repo_exists

 def test_repo_exists(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["distro_version"] == "trusty"
     assert result.json["distro"] == "ubuntu"
     assert result.json["ref"] == "firefly"
     assert result.json["sha1"] == "head"
开发者ID:ceph,项目名称:chacra,代码行数:17,代码来源:test_repos.py


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