當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。