Esempio n. 1
0
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])
Esempio n. 2
0
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])
Esempio n. 3
0
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])
Esempio n. 4
0
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])
Esempio n. 5
0
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],
        )
Esempio n. 6
0
    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'],
)
Esempio n. 7
0
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"],
)
Esempio n. 8
0
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])
Esempio n. 9
0
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,
    ],
)
Esempio n. 10
0
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,
                  ])
Esempio n. 11
0
from hookman.hooks import HookSpecs

specs = HookSpecs(project_name="ACME", version="1", hooks=[])
Esempio n. 12
0
from hookman.hooks import HookSpecs

specs = HookSpecs(
    project_name='ACME',
    version='1',
    hooks=[],
)
Esempio n. 13
0
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])
Esempio n. 14
0
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],
)