Completed
Pull Request — master (#15)
by
unknown
02:30
created

consumer()   A

Complexity

Conditions 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
c 1
b 0
f 0
dl 0
loc 4
rs 10
1
import pytest
2
from unittest.mock import Mock
3
4
from asynctest import Mock as AsyncMock  # flake8: NOQA
0 ignored issues
show
Configuration introduced by
The import asynctest could not be resolved.

This can be caused by one of the following:

1. Missing Dependencies

This error could indicate a configuration issue of Pylint. Make sure that your libraries are available by adding the necessary commands.

# .scrutinizer.yml
before_commands:
    - sudo pip install abc # Python2
    - sudo pip3 install abc # Python3
Tip: We are currently not using virtualenv to run pylint, when installing your modules make sure to use the command for the correct version.

2. Missing __init__.py files

This error could also result from missing __init__.py files in your module folders. Make sure that you place one file in each sub-folder.

Loading history...
5
from asynctest import CoroutineMock
0 ignored issues
show
Configuration introduced by
The import asynctest could not be resolved.

This can be caused by one of the following:

1. Missing Dependencies

This error could indicate a configuration issue of Pylint. Make sure that your libraries are available by adding the necessary commands.

# .scrutinizer.yml
before_commands:
    - sudo pip install abc # Python2
    - sudo pip3 install abc # Python3
Tip: We are currently not using virtualenv to run pylint, when installing your modules make sure to use the command for the correct version.

2. Missing __init__.py files

This error could also result from missing __init__.py files in your module folders. Make sure that you place one file in each sub-folder.

Loading history...
6
7
from loafer.route import Route
0 ignored issues
show
Bug introduced by
The name route does not seem to exist in module loafer.
Loading history...
Configuration introduced by
Unable to import 'loafer.route' (invalid syntax (<string>, line 24))

This can be caused by one of the following:

1. Missing Dependencies

This error could indicate a configuration issue of Pylint. Make sure that your libraries are available by adding the necessary commands.

# .scrutinizer.yml
before_commands:
    - sudo pip install abc # Python2
    - sudo pip3 install abc # Python3
Tip: We are currently not using virtualenv to run pylint, when installing your modules make sure to use the command for the correct version.

2. Missing __init__.py files

This error could also result from missing __init__.py files in your module folders. Make sure that you place one file in each sub-folder.

Loading history...
8
9
10
@pytest.fixture
11
def route():
12
    message_translator = Mock(translate=Mock(return_value={'content': 'message'}))
13
    route = AsyncMock(source='queue', message_handler='handler', message_handler_name='handler',
14
                      message_translator=message_translator, spec=Route)
15
    return route
16
17
18
@pytest.fixture
19
def consumer():
20
    return CoroutineMock(consume=CoroutineMock(return_value=['message']),
21
                         confirm_message=CoroutineMock())
22