def test_hook_specs_without_docs_arguments(): def method_with_docs_missing(a: 'int') -> 'int': pass # pragma: no cover with pytest.raises(TypeError, match="All hooks must have documentation"): specs = HookSpecs(project_name='acme', version='1', pyd_name='_acme', hooks=[method_with_docs_missing])
def test_hook_specs_without_docs_arguments(): def method_with_docs_missing(a: "int") -> "int": pass # pragma: no cover with pytest.raises(TypeError, match="All hooks must have documentation"): specs = HookSpecs(project_name="acme", version="1", pyd_name="_acme", hooks=[method_with_docs_missing])
def test_hook_specs_without_arguments(): def method_without_arguments() -> 'float': """ test_method_without_arguments """ # A hook must have parameters with pytest.raises(TypeError, match="It's not possible to create a hook without argument"): specs = HookSpecs(project_name='acme', version='1', pyd_name='_acme', hooks=[method_without_arguments])
def test_hook_specs_with_missing_type_on_argument(): def method_with_missing_type_on_argument(a: 'int', b) -> 'float': """ fail_method_with_missing_type_on_argument """ # A arguments of the hook must inform the type with pytest.raises(TypeError, match="All hooks arguments must have the type informed"): specs = HookSpecs(project_name='acme', version='1', pyd_name='_acme', hooks=[method_with_missing_type_on_argument])
def test_hook_specs_with_missing_type_on_argument(): def method_with_missing_type_on_argument(a: "int", b) -> "float": """ fail_method_with_missing_type_on_argument """ # A arguments of the hook must inform the type with pytest.raises( TypeError, match="All hooks arguments must have the type informed"): specs = HookSpecs( project_name="acme", version="1", pyd_name="_acme", hooks=[method_with_missing_type_on_argument], )
Docs for Friction Factor Input: Testing indentation Return: Integer """ def friction_factor_2(v1: 'int', v2: 'double[2]') -> 'int': """ Docs for Friction Factor 2 Input: Testing indentation Return: Integer Same signature as 'friction_factor' for testing. """ specs = HookSpecs( project_name='ACME', version='1', pyd_name='_test_hook_man_generator', hooks=[ friction_factor, friction_factor_2, ], extra_includes=['custom_include1', 'custom_include2'], )
def friction_factor(v1: "int", v2: "double[2]") -> "int": """ Docs for Friction Factor Input: Testing indentation Return: Integer """ def friction_factor_2(v1: "int", v2: "double[2]") -> "int": """ Docs for Friction Factor 2 Input: Testing indentation Return: Integer Same signature as 'friction_factor' for testing. """ specs = HookSpecs( project_name="ACME", version="1", pyd_name="_test_hook_man_generator", hooks=[friction_factor, friction_factor_2], extra_includes=["custom_include1", "custom_include2"], )
from hookman.hooks import HookSpecs def friction_factor(v1: "int", v2: "int") -> "int": """ Docs for Friction Factor """ def env_temperature(v3: "float", v4: "float") -> "float": """ Docs for Environment Temperature """ specs = HookSpecs(project_name="ACME", version="1", pyd_name="_test_cli", hooks=[friction_factor, env_temperature])
from hookman.hooks import HookSpecs def friction_factor(v1: 'int', v2: 'double[2]') -> 'int': """ Docs for Friction Factor Input: Testing indentation Return: Integer """ specs = HookSpecs( project_name='ACME', version='1', pyd_name='_test_hook_man_generator', hooks=[ friction_factor, ], )
from hookman.hooks import HookSpecs def friction_factor(v1: 'int', v2: 'int') -> 'int': """ Docs for Friction Factor """ def env_temperature(v3: 'float', v4: 'float') -> 'float': """ Docs for Environment Temperature """ specs = HookSpecs(project_name='ACME', version='1', pyd_name='_simple', hooks=[ friction_factor, env_temperature, ])
from hookman.hooks import HookSpecs specs = HookSpecs(project_name="ACME", version="1", hooks=[])
from hookman.hooks import HookSpecs specs = HookSpecs( project_name='ACME', version='1', hooks=[], )
from hookman.hooks import HookSpecs def friction_factor(v1: "int", v2: "double[2]") -> "int": """ Docs for Friction Factor Input: Testing indentation Return: Integer """ specs = HookSpecs(project_name="ACME", version="1", pyd_name="_test_hook_man_generator", hooks=[friction_factor])
from hookman.hooks import HookSpecs def friction_factor(v1: "int", v2: "int") -> "int": """ Docs for Friction Factor """ def friction_factor_2(v1: "int", v2: "int") -> "int": """ Docs for Friction Factor Just to test a duplicated signature """ def env_temperature(v3: "float", v4: "float") -> "float": """ Docs for Environment Temperature """ specs = HookSpecs( project_name="ACME", version="1", pyd_name="_simple", hooks=[friction_factor, friction_factor_2, env_temperature], )