from pipeline.tiers import classify_tier, TIER1_BASIC, TIER2_PER_LIBRARY, TIER3_REAL_WORLD LIBS = {"json": "...", "os": "...", "requests": "..."} def test_no_imports_is_tier1(): assert classify_tier([], LIBS) == (TIER1_BASIC, None) def test_single_known_library_is_tier2(): assert classify_tier(["json"], LIBS) == (TIER2_PER_LIBRARY, "json") def test_multiple_known_libraries_tags_alphabetically_first(): assert classify_tier(["requests", "json"], LIBS) == (TIER2_PER_LIBRARY, "json") def test_unknown_import_is_tier3(): assert classify_tier(["some_unknown_pkg"], LIBS) == (TIER3_REAL_WORLD, None) def test_mixed_known_and_unknown_is_tier3(): assert classify_tier(["json", "some_unknown_pkg"], LIBS) == (TIER3_REAL_WORLD, None)