diff --git a/napalm_linux/linux.py b/napalm_linux/linux.py index 57ff7f7..e753752 100644 --- a/napalm_linux/linux.py +++ b/napalm_linux/linux.py @@ -23,7 +23,7 @@ import logging import re import socket from shlex import quote as _shlex_quote -from typing import Any +from typing import Any, Dict, List, Optional from netmiko import ConnectHandler from netmiko.exceptions import ( diff --git a/tests/test_fix_templates.py b/tests/test_fix_templates.py index 60aadc8..3b1e6d4 100644 --- a/tests/test_fix_templates.py +++ b/tests/test_fix_templates.py @@ -180,3 +180,14 @@ def test_run_device_action_is_gone(): "_action_apt_update_upgrade", ): assert not hasattr(LinuxDriver, name), name + + +def test_every_annotation_resolves(): + """``Dict``, ``List`` and ``Optional`` were used without being imported (#29); + ``from __future__ import annotations`` hid it until something resolved them.""" + import inspect + import typing + + for name, member in inspect.getmembers(LinuxDriver, inspect.isfunction): + if member.__module__ == "napalm_linux.linux": + typing.get_type_hints(member)