Skip to content

Debloat any Android or Google TV over Wi-Fi and get an Apple TV-style home.

tests: the card test pins every page in STORY_PAGES

Bilal Vural35b196e209d4
diff --git a/docs/workflows/press.md b/docs/workflows/press.md
index ac0bcd407..58f2f1e8e 100644
--- a/docs/workflows/press.md
+++ b/docs/workflows/press.md
@@ -10,7 +10,7 @@
more: N articles from N countries"), the Dutch `README.nl.md` ("nog N media: N artikelen uit N landen") and
the German `README.de.md` ("und N weitere: N Artikel aus N Ländern"), the Ukrainian
`README.uk.md` ("та ще N видань: N статей із N країн") and the Turkish `README.tr.md`
- ("ve N yayın daha: N ülkeden N makale") - and `MORE` in
+ ("ve N yayın daha: N ülkeden N makale", the country count before the article total) - and `MORE` in
`tools/readme_featured.py`. Every page shows the same picture, so a translation that copies it states the
same numbers in its own words: the pages named here are the ones that carry it today, not the rule.
The end of each page's story section repeats the three numbers once more, in prose ("The coverage: 351
diff --git a/docs/workflows/tv-list.md b/docs/workflows/tv-list.md
index d45c59a2b..cafa18a7c 100644
--- a/docs/workflows/tv-list.md
+++ b/docs/workflows/tv-list.md
@@ -29,9 +29,9 @@
has room for `Google TV launcher on Android TV 11`, the short one for `Google TV 11`.
`tests/test_examples.py` checks the file.
5. Change nothing outside the folder. The tables in `examples/README.md` and `README.nl.md`, the brand grid in
- `README.md`, `README.nl.md`, `README.de.md`, `README.uk.md` and `README.tr.md`, and the counts (the `TV models` number in the card's alt text)
- are generated from every `tv.json` by `tools/gen_tables.py`, which a maintainer runs after merging; CI compares
- them only on `main`.
+ `README.md`, `README.nl.md`, `README.de.md`, `README.uk.md` and `README.tr.md`, and the counts (the
+ `TV models` number in the card's alt text) are generated from every `tv.json` by `tools/gen_tables.py`,
+ which a maintainer runs after merging; CI compares them only on `main`.
One copy of those counts is outside the generated blocks: the story sentence that shows the card on the same
five front pages ("The lists now cover 387 TV models from 103 brands") is prose, so a regeneration moves the
picture and leaves the sentence where it was - the round that took the tree to 387 models shipped 380 in the
diff --git a/tests/test_press_counts.py b/tests/test_press_counts.py
index d60998624..2ce37b180 100644
--- a/tests/test_press_counts.py
+++ b/tests/test_press_counts.py
@@ -3,10 +3,9 @@
The article total is written in every place that states it: the PRESS.md intro, its per-country index
line, the alt text of the card in README.md, the alt text of the same card in README.nl.md (in Dutch),
README.de.md (in German), README.uk.md (in Ukrainian) and README.tr.md (in Turkish), and
-tools/readme_featured.py (which draws the line onto
-docs/featured.png). Adding one article by hand means editing all of them; this checks they agree, so a
-PR that adds a row and forgets the counts fails here instead of shipping a card that says 73 over a
-list of 74.
+tools/readme_featured.py (which draws the line onto docs/featured.png). Adding one article by hand
+means editing all of them; this checks they agree, so a PR that adds a row and forgets the counts
+fails here instead of shipping a card that says 73 over a list of 74.
The Videos section at the end of the same page is read the same way, and had nothing reading it: the
intro ends "[229 videos](#videos) follow the articles", the section's own line says when the view
@@ -58,9 +57,9 @@ MONTHS = {name: number for number, name in enumerate(
("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"), 1)}
# A video row links its YouTube or Bilibili watch page.
VIDEO_LINK = re.compile(r"\((https?://[^)\s]*(?:youtube\.com|bilibili\.com)/[^)\s]+)\)")
-# The card image the numbers are drawn on, wherever a README shows it: README.md in English, README.nl.md
-# in Dutch and README.de.md in German, and any translation that copies the picture later. The words
-# around the numbers are translated; the numbers are not.
+# The card image the numbers are drawn on, wherever a README shows it: STORY_PAGES below, and any
+# translation that copies the picture later. The words around the numbers are translated; the numbers
+# are not.
CARD_ALT = re.compile(r'src="docs/card(?:-halloween)?\.jpg"[^>]*?alt="([^"]*)"')
# The front pages that show the card and repeat its numbers in the story section today.
STORY_PAGES = ("README.md", "README.de.md", "README.nl.md", "README.uk.md", "README.tr.md")
@@ -355,8 +354,8 @@ class PressCountsTest(unittest.TestCase):
# the Dutch front page claiming an older count. The German page is the case the recipe still
# missed: it carries the same picture, so the next article had to be added there by hand too.
alts = card_alt_texts()
- self.assertLessEqual({"README.md", "README.nl.md", "README.de.md"}, set(alts),
- "README.md, README.nl.md and README.de.md no longer show docs/card.jpg with an alt text")
+ self.assertLessEqual(set(STORY_PAGES), set(alts),
+ f"{', '.join(STORY_PAGES)} no longer all show docs/card-halloween.jpg with an alt text")
numbers = (("article total", self.numbers["total"]),
("country count", self.numbers["countries"]),
("'+N more'", self.numbers["total"] - len(logos())))
diff --git a/tests/test_readme_theme_count.py b/tests/test_readme_theme_count.py
index 36dc812a7..49d3f3a61 100644
--- a/tests/test_readme_theme_count.py
+++ b/tests/test_readme_theme_count.py
@@ -57,8 +57,9 @@ ROW_START = "| **Themes** |"
# Every feature row that names themes/ and states how many ship there, whatever language it is in:
# English "eleven ship in", German "Zehn liegen in", Dutch "staan tien thema's", Ukrainian
# "постачається чотирнадцять". The words come from the four languages whose front pages write the
-# count as a word today (README.tr.md writes digits), two to twenty each; one is left out because "een" and "ein" are also the articles those
-# languages put before a noun, so an English "one" would read a Dutch sentence as a claim of one theme.
+# count as a word today (README.tr.md writes digits), two to twenty each; one is left out because
+# "een" and "ein" are also the articles those languages put before a noun, so an English "one" would
+# read a Dutch sentence as a claim of one theme.
NUMBER_WORDS = {"two": 2, "three": 3, "four": 4, "five": 5, "six": 6, "seven": 7, "eight": 8,
"nine": 9, "ten": 10, "eleven": 11, "twelve": 12,
"thirteen": 13, "fourteen": 14, "fifteen": 15, "sixteen": 16,
diff --git a/tools/gen_tables.py b/tools/gen_tables.py
index e13eb6dba..48f55bb4f 100644
--- a/tools/gen_tables.py
+++ b/tools/gen_tables.py
@@ -27,8 +27,8 @@ The full table lives in examples/README.md between <!-- tv-table:start ... --> a
README.md has no table of its own: its brand grid (the TOP brands with the most lists, linked to the site's
search, and the rest in a <details>) sits between <!-- tv-brands:start ... --> and <!-- tv-brands:end -->.
README.nl.md, README.de.md, README.uk.md and README.tr.md carry the same brand block and the same counts in
-their own words ("N tv-modellen · B merken · L talen · ", "N TV-Modelle · B Marken · L Sprachen · ", ...), and a README that still
-has tv-table markers gets the short table there too. Everything outside the markers is hand-written.
+their own words ("N tv-modellen · B merken · L talen · ", "N TV-Modelle · B Marken · L Sprachen · ",
+...), and a README that still has tv-table markers gets the short table there too. Everything outside the markers is hand-written.
The counts are the card's alt text ("N TV models · B brands · L languages · "), the "| **L languages** |"
feature row and STATS in tools/readme_stats.py. Exit codes: 0 up to date (or written), 1 out of date
(--check), or a count moved and --font could not draw one of the pictures (the tables are written; the