コード例 #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])
コード例 #2
0
ファイル: test_hooks.py プロジェクト: williamjamir/hookman
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])
コード例 #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])
コード例 #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])
コード例 #5
0
ファイル: test_hooks.py プロジェクト: williamjamir/hookman
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],
        )
コード例 #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'],
)
コード例 #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"],
)
コード例 #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])
コード例 #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,
    ],
)
コード例 #10
0
ファイル: hook_specs.py プロジェクト: nicoddemus/hookman
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,
                  ])
コード例 #11
0
from hookman.hooks import HookSpecs

specs = HookSpecs(project_name="ACME", version="1", hooks=[])
コード例 #12
0
from hookman.hooks import HookSpecs

specs = HookSpecs(
    project_name='ACME',
    version='1',
    hooks=[],
)
コード例 #13
0
ファイル: hook_specs_2.py プロジェクト: williamjamir/hookman
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])
コード例 #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],
)