MCPcopy
hub / github.com/vinta/awesome-python / test_basic_extraction

Method test_basic_extraction

website/tests/test_build.py:1059–1081  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1057
1058class TestExtractEntries:
1059 def test_basic_extraction(self):
1060 readme = textwrap.dedent("""\
1061 # T
1062
1063 ## Projects
1064
1065 **Tools**
1066
1067 ## Widgets
1068
1069 - [widget](https://example.com) - A widget.
1070
1071 # Contributing
1072
1073 Done.
1074 """)
1075 groups = parse_readme(readme)
1076 categories = [c for g in groups for c in g["categories"]]
1077 entries = extract_entries(categories, groups)
1078 assert len(entries) == 1
1079 assert entries[0]["name"] == "widget"
1080 assert entries[0]["categories"] == ["Widgets"]
1081 assert entries[0]["groups"] == ["Tools"]
1082
1083 def test_duplicate_entry_merged(self):
1084 readme = textwrap.dedent("""\

Callers

nothing calls this directly

Calls 2

parse_readmeFunction · 0.90
extract_entriesFunction · 0.90

Tested by

no test coverage detected