| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent dc32d54 commit cfed622
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -11,9 +11,9 @@ def classref(value, short=True): | |||
| 11 | 11 | return value | |
| 12 | 12 | ||
| 13 | 13 | if not inspect.isclass(value): | |
| 14 | - return ":class:%s" % value | ||
| 14 | + return f":class:{value}" | ||
| 15 | 15 | tilde = "~" if short else "" | |
| 16 | - return ":class:`%sgitlab.objects.%s`" % (tilde, value.__name__) | ||
| 16 | + return f":class:`{tilde}gitlab.objects.{value.__name__}`" | ||
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | 19 | def setup(app): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -106,12 +106,11 @@ def test_project_file_uploads(project): | |||
| 106 | 106 | file_contents = "testing contents" | |
| 107 | 107 | ||
| 108 | 108 | uploaded_file = project.upload(filename, file_contents) | |
| 109 | - assert uploaded_file["alt"] == filename | ||
| 110 | - assert uploaded_file["url"].startswith("/uploads/") | ||
| 111 | - assert uploaded_file["url"].endswith(f"/{filename}") | ||
| 112 | - assert uploaded_file["markdown"] == "[{}]({})".format( | ||
| 113 | - uploaded_file["alt"], uploaded_file["url"] | ||
| 114 | - ) | ||
| 109 | + alt, url = uploaded_file["alt"], uploaded_file["url"] | ||
| 110 | + assert alt == filename | ||
| 111 | + assert url.startswith("/uploads/") | ||
| 112 | + assert url.endswith(f"/{filename}") | ||
| 113 | + assert uploaded_file["markdown"] == f"[{alt}]({url})" | ||
| 115 | 114 | ||
| 116 | 115 | ||
| 117 | 116 | def test_project_forks(gl, project, user): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -107,11 +107,7 @@ | |||
| 107 | 107 | package_version = "v1.0.0" | |
| 108 | 108 | file_name = "hello.tar.gz" | |
| 109 | 109 | file_content = "package content" | |
| 110 | - package_url = "http://localhost/api/v4/projects/1/packages/generic/{}/{}/{}".format( | ||
| 111 | - package_name, | ||
| 112 | - package_version, | ||
| 113 | - file_name, | ||
| 114 | - ) | ||
| 110 | + package_url = f"http://localhost/api/v4/projects/1/packages/generic/{package_name}/{package_version}/{file_name}" | ||
| 115 | 111 | ||
| 116 | 112 | ||
| 117 | 113 | @pytest.fixture | |
| Back | FazBrowse Home | New Git URL |
0 commit comments