Merge remote-tracking branch 'origin/main' into 40c3
This commit is contained in:
commit
9b248b11a2
2 changed files with 13 additions and 8 deletions
|
|
@ -32,6 +32,11 @@ jobs:
|
|||
fetch-depth: 0 # pull full history for page lastmod by git commit date
|
||||
submodules: recursive
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
apk add python3
|
||||
python3 -m unittest discover -s tests -v
|
||||
|
||||
- name: Patch baseURL (staging only)
|
||||
if: github.ref_name != 'main'
|
||||
run: |
|
||||
|
|
|
|||
|
|
@ -31,18 +31,18 @@ class BrandLintTest(unittest.TestCase):
|
|||
)
|
||||
|
||||
def test_errors_include_spelling_and_source_line(self):
|
||||
result = self.build("---\ntitle: Hackertours\n---\nHACKERTOURS and hackertours\n")
|
||||
result = self.build("---\ntitle: HackerTours\n---\nHACKERTOURS and hackertours\n")
|
||||
self.assertNotEqual(result.returncode, 0)
|
||||
for line, spelling in [(2, "Hackertours"), (4, "HACKERTOURS"), (4, "hackertours")]:
|
||||
for line, spelling in [(2, "HackerTours"), (4, "HACKERTOURS"), (4, "hackertours")]:
|
||||
self.assertIn(f':{line}: "{spelling}" should be "Hackertours"', result.stderr)
|
||||
|
||||
def test_valid_names_identifiers_and_explicit_exceptions(self):
|
||||
result = self.build(
|
||||
"---\n"
|
||||
"title: Hackertours # hackertours-lint-ignore\n"
|
||||
"title: HackerTours # hackertours-lint-ignore\n"
|
||||
"---\n"
|
||||
"Hackertours\n"
|
||||
"Hackertours <!-- hackertours-lint-ignore -->\n"
|
||||
"HackerTours <!-- hackertours-lint-ignore -->\n"
|
||||
"[Shop](https://hackertours.example/hackertours) "
|
||||
"ticket@hackertours.example @hackertours "
|
||||
"#easterhegg-hackertours:example.org\n"
|
||||
|
|
@ -52,12 +52,12 @@ class BrandLintTest(unittest.TestCase):
|
|||
def test_marker_only_ignores_its_own_line(self):
|
||||
result = self.build(
|
||||
"---\ntitle: Hackertours\n---\n"
|
||||
"Hackertours <!-- hackertours-lint-ignore -->\n"
|
||||
"Hackertours\n"
|
||||
"HackerTours <!-- hackertours-lint-ignore -->\n"
|
||||
"HackerTours\n"
|
||||
)
|
||||
self.assertNotEqual(result.returncode, 0)
|
||||
self.assertIn(':5: "Hackertours" should be "Hackertours"', result.stderr)
|
||||
self.assertNotIn(':4: "Hackertours" should be "Hackertours"', result.stderr)
|
||||
self.assertIn(':5: "HackerTours" should be "Hackertours"', result.stderr)
|
||||
self.assertNotIn(':4: "HackerTours" should be "Hackertours"', result.stderr)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
|
|||
Loading…
Reference in a new issue