mirror of
https://github.com/vinta/awesome-python.git
synced 2026-08-03 22:40:46 +00:00
refactor(build): inline format_stars_short into its call site
The helper only appeared once and the logic is two lines, so the named function added indirection without clarity. Removed the four dedicated unit tests that covered the function directly. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
85b55efb28
commit
39b65bc994
2 changed files with 4 additions and 28 deletions
|
|
@ -10,7 +10,6 @@ from build import (
|
|||
detect_source_type,
|
||||
extract_entries,
|
||||
extract_github_repo,
|
||||
format_stars_short,
|
||||
load_stars,
|
||||
sort_entries,
|
||||
)
|
||||
|
|
@ -363,25 +362,6 @@ class TestDetectSourceType:
|
|||
assert detect_source_type("https://github.com/org/repo/wiki") is None
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# format_stars_short
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
|
||||
class TestFormatStarsShort:
|
||||
def test_under_1000(self):
|
||||
assert format_stars_short(500) == "500"
|
||||
|
||||
def test_exactly_1000(self):
|
||||
assert format_stars_short(1000) == "1k"
|
||||
|
||||
def test_large_number(self):
|
||||
assert format_stars_short(52000) == "52k"
|
||||
|
||||
def test_zero(self):
|
||||
assert format_stars_short(0) == "0"
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# extract_entries
|
||||
# ---------------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue