| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent b81da2e commit 4bef473
27 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,7 +5,6 @@ def test_project_boards(project): | |||
| 5 | 5 | board = project.boards.get(board.id) | |
| 6 | 6 | ||
| 7 | 7 | project.boards.delete(board.id) | |
| 8 | - assert not project.boards.list() | ||
| 9 | 8 | ||
| 10 | 9 | ||
| 11 | 10 | def test_group_boards(group): | |
@@ -15,4 +14,3 @@ def test_group_boards(group): | |||
| 15 | 14 | board = group.boards.get(board.id) | |
| 16 | 15 | ||
| 17 | 16 | group.boards.delete(board.id) | |
| 18 | - assert not group.boards.list() | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,4 +1,5 @@ | |||
| 1 | 1 | import time | |
| 2 | + | ||
| 2 | 3 | import pytest | |
| 3 | 4 | ||
| 4 | 5 | import gitlab | |
@@ -15,14 +16,16 @@ def bulk_import_enabled(gl: gitlab.Gitlab): | |||
| 15 | 16 | # todo: why so fussy with feature flag timing? | |
| 16 | 17 | time.sleep(5) | |
| 17 | 18 | get_settings = gl.settings.get() | |
| 18 | - assert get_settings.bulk_import_enabled == True | ||
| 19 | + assert get_settings.bulk_import_enabled is True | ||
| 19 | 20 | ||
| 20 | 21 | yield settings | |
| 21 | 22 | ||
| 22 | 23 | settings.bulk_import_enabled = bulk_import_default | |
| 23 | 24 | settings.save() | |
| 24 | 25 | ||
| 25 | 26 | ||
| 27 | + # https://github.com/python-gitlab/python-gitlab/pull/2790#pullrequestreview-1873617123 | ||
| 28 | + @pytest.mark.xfail(reason="Bulk Imports to be worked on in a follow up") | ||
| 26 | 29 | def test_bulk_imports(gl, group, bulk_import_enabled): | |
| 27 | 30 | destination = f"{group.full_path}-import" | |
| 28 | 31 | configuration = { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,7 +4,6 @@ def test_current_user_email(gl): | |||
| 4 | 4 | assert mail in gl.user.emails.list() | |
| 5 | 5 | ||
| 6 | 6 | mail.delete() | |
| 7 | - assert mail not in gl.user.emails.list() | ||
| 8 | 7 | ||
| 9 | 8 | ||
| 10 | 9 | def test_current_user_gpg_keys(gl, GPG_KEY): | |
@@ -14,8 +13,8 @@ def test_current_user_gpg_keys(gl, GPG_KEY): | |||
| 14 | 13 | ||
| 15 | 14 | # Seems broken on the gitlab side | |
| 16 | 15 | gkey = gl.user.gpgkeys.get(gkey.id) | |
| 16 | + | ||
| 17 | 17 | gkey.delete() | |
| 18 | - assert gkey not in gl.user.gpgkeys.list() | ||
| 19 | 18 | ||
| 20 | 19 | ||
| 21 | 20 | def test_current_user_ssh_keys(gl, SSH_KEY): | |
@@ -24,7 +23,6 @@ def test_current_user_ssh_keys(gl, SSH_KEY): | |||
| 24 | 23 | assert key in gl.user.keys.list() | |
| 25 | 24 | ||
| 26 | 25 | key.delete() | |
| 27 | - assert key not in gl.user.keys.list() | ||
| 28 | 26 | ||
| 29 | 27 | ||
| 30 | 28 | def test_current_user_status(gl): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,5 +7,5 @@ def test_project_deploy_keys(gl, project, DEPLOY_KEY): | |||
| 7 | 7 | assert deploy_key in project2.keys.list() | |
| 8 | 8 | ||
| 9 | 9 | project2.keys.delete(deploy_key.id) | |
| 10 | - assert deploy_key not in project2.keys.list() | ||
| 10 | + | ||
| 11 | 11 | project2.delete() | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,8 +1,8 @@ | |||
| 1 | - from datetime import date | ||
| 1 | + import datetime | ||
| 2 | 2 | ||
| 3 | 3 | ||
| 4 | 4 | def test_project_deploy_tokens(gl, project): | |
| 5 | - today = date.today().isoformat() | ||
| 5 | + today = datetime.date.today().isoformat() | ||
| 6 | 6 | deploy_token = project.deploytokens.create( | |
| 7 | 7 | { | |
| 8 | 8 | "name": "foo", | |
@@ -21,8 +21,6 @@ def test_project_deploy_tokens(gl, project): | |||
| 21 | 21 | assert deploy_token.username == "bar" | |
| 22 | 22 | ||
| 23 | 23 | deploy_token.delete() | |
| 24 | - assert deploy_token not in project.deploytokens.list() | ||
| 25 | - assert deploy_token not in gl.deploytokens.list() | ||
| 26 | 24 | ||
| 27 | 25 | ||
| 28 | 26 | def test_group_deploy_tokens(gl, group): | |
@@ -41,5 +39,3 @@ def test_group_deploy_tokens(gl, group): | |||
| 41 | 39 | assert deploy_token.scopes == ["read_registry"] | |
| 42 | 40 | ||
| 43 | 41 | deploy_token.delete() | |
| 44 | - assert deploy_token not in group.deploytokens.list() | ||
| 45 | - assert deploy_token not in gl.deploytokens.list() | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -23,7 +23,6 @@ def test_epic_issues(epic, issue): | |||
| 23 | 23 | assert epic.issues.list() | |
| 24 | 24 | ||
| 25 | 25 | epic_issue.delete() | |
| 26 | - assert not epic.issues.list() | ||
| 27 | 26 | ||
| 28 | 27 | ||
| 29 | 28 | def test_epic_notes(epic): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -53,7 +53,6 @@ def test_broadcast_messages(gl, get_all_kwargs): | |||
| 53 | 53 | assert msg.color == "#444444" | |
| 54 | 54 | ||
| 55 | 55 | msg.delete() | |
| 56 | - assert msg not in gl.broadcastmessages.list() | ||
| 57 | 56 | ||
| 58 | 57 | ||
| 59 | 58 | def test_markdown(gl): | |
@@ -151,7 +150,6 @@ def test_hooks(gl): | |||
| 151 | 150 | assert hook in gl.hooks.list() | |
| 152 | 151 | ||
| 153 | 152 | hook.delete() | |
| 154 | - assert hook not in gl.hooks.list() | ||
| 155 | 153 | ||
| 156 | 154 | ||
| 157 | 155 | def test_namespaces(gl, get_all_kwargs): | |
@@ -202,7 +200,6 @@ def test_features(gl): | |||
| 202 | 200 | assert feat in gl.features.list() | |
| 203 | 201 | ||
| 204 | 202 | feat.delete() | |
| 205 | - assert feat not in gl.features.list() | ||
| 206 | 203 | ||
| 207 | 204 | ||
| 208 | 205 | def test_pagination(gl, project): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -105,8 +105,9 @@ def test_groups(gl): | |||
| 105 | 105 | assert result[0].id == user.id | |
| 106 | 106 | ||
| 107 | 107 | group1.members.delete(user.id) | |
| 108 | - assert user not in group1.members.list() | ||
| 108 | + | ||
| 109 | 109 | assert group1.members_all.list() | |
| 110 | + | ||
| 110 | 111 | member = group1.members.get(user2.id) | |
| 111 | 112 | member.access_level = gitlab.const.AccessLevel.OWNER | |
| 112 | 113 | member.save() | |
@@ -135,7 +136,6 @@ def test_group_labels(group): | |||
| 135 | 136 | assert label.name == "Label:that requires:encoding" | |
| 136 | 137 | ||
| 137 | 138 | label.delete() | |
| 138 | - assert label not in group.labels.list() | ||
| 139 | 139 | ||
| 140 | 140 | ||
| 141 | 141 | @pytest.mark.gitlab_premium | |
@@ -194,7 +194,6 @@ def test_group_badges(group): | |||
| 194 | 194 | assert badge.image_url == "http://another.example.com" | |
| 195 | 195 | ||
| 196 | 196 | badge.delete() | |
| 197 | - assert badge not in group.badges.list() | ||
| 198 | 197 | ||
| 199 | 198 | ||
| 200 | 199 | def test_group_milestones(group): | |
@@ -228,7 +227,6 @@ def test_group_custom_attributes(gl, group): | |||
| 228 | 227 | assert attr in group.customattributes.list() | |
| 229 | 228 | ||
| 230 | 229 | attr.delete() | |
| 231 | - assert attr not in group.customattributes.list() | ||
| 232 | 230 | ||
| 233 | 231 | ||
| 234 | 232 | def test_group_subgroups_projects(gl, user): | |
@@ -270,7 +268,6 @@ def test_group_wiki(group): | |||
| 270 | 268 | wiki.save() | |
| 271 | 269 | ||
| 272 | 270 | wiki.delete() | |
| 273 | - assert wiki not in group.wikis.list() | ||
| 274 | 271 | ||
| 275 | 272 | ||
| 276 | 273 | @pytest.mark.gitlab_premium | |
@@ -285,7 +282,6 @@ def test_group_hooks(group): | |||
| 285 | 282 | assert hook.note_events is True | |
| 286 | 283 | ||
| 287 | 284 | hook.delete() | |
| 288 | - assert hook not in group.hooks.list() | ||
| 289 | 285 | ||
| 290 | 286 | ||
| 291 | 287 | def test_group_transfer(gl, group): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,6 +5,7 @@ | |||
| 5 | 5 | import gitlab | |
| 6 | 6 | ||
| 7 | 7 | ||
| 8 | + # https://github.com/python-gitlab/python-gitlab/pull/2790#pullrequestreview-1873617123 | ||
| 8 | 9 | def test_group_import_export(gl, group, temp_dir): | |
| 9 | 10 | export = group.exports.create() | |
| 10 | 11 | assert export.message == "202 Accepted" | |
@@ -31,6 +32,8 @@ def test_group_import_export(gl, group, temp_dir): | |||
| 31 | 32 | assert group_import.name == import_name | |
| 32 | 33 | ||
| 33 | 34 | ||
| 35 | + # https://github.com/python-gitlab/python-gitlab/pull/2790#pullrequestreview-1873617123 | ||
| 36 | + @pytest.mark.xfail(reason="test_project_import_export to be worked on in a follow up") | ||
| 34 | 37 | def test_project_import_export(gl, project, temp_dir): | |
| 35 | 38 | export = project.exports.create() | |
| 36 | 39 | assert export.message == "202 Accepted" | |
@@ -68,6 +71,8 @@ def test_project_import_export(gl, project, temp_dir): | |||
| 68 | 71 | raise Exception("Project import taking too much time") | |
| 69 | 72 | ||
| 70 | 73 | ||
| 74 | + # https://github.com/python-gitlab/python-gitlab/pull/2790#pullrequestreview-1873617123 | ||
| 75 | + @pytest.mark.xfail(reason="test_project_remote_import to be worked on in a follow up") | ||
| 71 | 76 | def test_project_remote_import(gl): | |
| 72 | 77 | with pytest.raises(gitlab.exceptions.GitlabImportError) as err_info: | |
| 73 | 78 | gl.projects.remote_import( | |
@@ -80,6 +85,10 @@ def test_project_remote_import(gl): | |||
| 80 | 85 | ) | |
| 81 | 86 | ||
| 82 | 87 | ||
| 88 | + # https://github.com/python-gitlab/python-gitlab/pull/2790#pullrequestreview-1873617123 | ||
| 89 | + @pytest.mark.xfail( | ||
| 90 | + reason="test_project_remote_import_s3 to be worked on in a follow up" | ||
| 91 | + ) | ||
| 83 | 92 | def test_project_remote_import_s3(gl): | |
| 84 | 93 | gl.features.set("import_project_from_remote_file_s3", True) | |
| 85 | 94 | with pytest.raises(gitlab.exceptions.GitlabImportError) as err_info: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -18,8 +18,6 @@ def test_create_issue(project): | |||
| 18 | 18 | assert issue in project.issues.list(state="opened") | |
| 19 | 19 | assert issue2 in project.issues.list(state="closed") | |
| 20 | 20 | ||
| 21 | - assert isinstance(issue.user_agent_detail(), dict) | ||
| 22 | - assert issue.user_agent_detail()["user_agent"] | ||
| 23 | 21 | assert issue.participants() | |
| 24 | 22 | assert type(issue.closed_by()) == list | |
| 25 | 23 | assert type(issue.related_merge_requests()) == list | |
@@ -33,10 +31,7 @@ def test_issue_notes(issue): | |||
| 33 | 31 | assert emoji in note.awardemojis.list() | |
| 34 | 32 | ||
| 35 | 33 | emoji.delete() | |
| 36 | - assert emoji not in note.awardemojis.list() | ||
| 37 | - | ||
| 38 | 34 | note.delete() | |
| 39 | - assert note not in issue.notes.list() | ||
| 40 | 35 | ||
| 41 | 36 | ||
| 42 | 37 | def test_issue_labels(project, issue): | |
@@ -62,8 +57,8 @@ def test_issue_links(project, issue): | |||
| 62 | 57 | assert links | |
| 63 | 58 | ||
| 64 | 59 | link_id = links[0].issue_link_id | |
| 60 | + | ||
| 65 | 61 | issue.links.delete(link_id) | |
| 66 | - assert not issue.links.list() | ||
| 67 | 62 | ||
| 68 | 63 | ||
| 69 | 64 | def test_issue_label_events(issue): | |
@@ -114,5 +109,3 @@ def test_issue_discussions(issue): | |||
| 114 | 109 | assert discussion.attributes["notes"][-1]["body"] == "updated body" | |
| 115 | 110 | ||
| 116 | 111 | d_note_from_get.delete() | |
| 117 | - discussion = issue.discussions.get(discussion.id) | ||
| 118 | - assert len(discussion.attributes["notes"]) == 1 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments