File: _helpers.py

package info (click to toggle)
python-asdf 4.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 7,032 kB
  • sloc: python: 24,068; makefile: 123
file content (25 lines) | stat: -rw-r--r-- 606 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from urllib.parse import urljoin


def issues_url(organization, repository):
    return urljoin(
        "https://github.com/", f"{organization}/{repository}/issues/",
    )


ISSUES_URL = issues_url("asdf-format", "asdf")
TEST_SUITE_ISSUES_URL = issues_url("json-schema-org", "JSON-Schema-Test-Suite")


def bug(issue=None):
    message = "A known bug."
    if issue is not None:
        message += f" See {urljoin(ISSUES_URL, str(issue))}."
    return message


def test_suite_bug(issue):
    return (
        "A known test suite bug. "
        f"See {urljoin(TEST_SUITE_ISSUES_URL, str(issue))}."
    )