Files
FusionAGI/.venv/lib/python3.12/site-packages/mypy/test/teststubinfo.py
defiQUG c052b07662
Some checks failed
Tests / test (3.10) (push) Has been cancelled
Tests / test (3.11) (push) Has been cancelled
Tests / test (3.12) (push) Has been cancelled
Tests / lint (push) Has been cancelled
Tests / docker (push) Has been cancelled
Initial commit: add .gitignore and README
2026-02-09 21:51:42 -08:00

36 lines
1.5 KiB
Python

from __future__ import annotations
import unittest
from mypy.stubinfo import (
is_module_from_legacy_bundled_package,
legacy_bundled_packages,
non_bundled_packages_flat,
stub_distribution_name,
)
class TestStubInfo(unittest.TestCase):
def test_is_legacy_bundled_packages(self) -> None:
assert not is_module_from_legacy_bundled_package("foobar_asdf")
assert not is_module_from_legacy_bundled_package("PIL")
assert is_module_from_legacy_bundled_package("pycurl")
assert is_module_from_legacy_bundled_package("dateparser")
def test_stub_distribution_name(self) -> None:
assert stub_distribution_name("foobar_asdf") is None
assert stub_distribution_name("pycurl") == "types-pycurl"
assert stub_distribution_name("psutil") == "types-psutil"
assert stub_distribution_name("sassutils") == "types-libsass"
assert stub_distribution_name("google.cloud.ndb") == "types-google-cloud-ndb"
assert stub_distribution_name("google.cloud.ndb.submodule") == "types-google-cloud-ndb"
assert stub_distribution_name("google.cloud.unknown") is None
assert stub_distribution_name("google.protobuf") == "types-protobuf"
assert stub_distribution_name("google.protobuf.submodule") == "types-protobuf"
assert stub_distribution_name("google") is None
def test_period_in_top_level(self) -> None:
for packages in (non_bundled_packages_flat, legacy_bundled_packages):
for top_level_module in packages:
assert "." not in top_level_module