Passed
Push — master ( a89d59...20106a )
by George
02:09
created

test_sns_queue_route_keep_name()   A

Complexity

Conditions 2

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
from unittest import mock
2
3
from loafer.ext.aws.message_translators import SQSMessageTranslator, SNSMessageTranslator
4
from loafer.ext.aws.providers import SQSProvider
0 ignored issues
show
Bug introduced by
The name providers does not seem to exist in module loafer.ext.aws.
Loading history...
Configuration introduced by
Unable to import 'loafer.ext.aws.providers' (invalid syntax (<string>, line 27))

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 loafer.ext.aws.routes import SQSRoute, SNSQueueRoute
6
7
8
def test_sqs_route():
9
    route = SQSRoute('what', handler='ever')
10
    assert isinstance(route.message_translator, SQSMessageTranslator)
0 ignored issues
show
Bug introduced by
The Instance of SQSRoute does not seem to have a member named message_translator.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
11
    assert isinstance(route.provider, SQSProvider)
0 ignored issues
show
Bug introduced by
The Instance of SQSRoute does not seem to have a member named provider.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
12
    assert route.name == 'what'
0 ignored issues
show
Bug introduced by
The Instance of SQSRoute does not seem to have a member named name.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
13
14
15
def test_sqs_route_keep_message_translator():
0 ignored issues
show
Coding Style Naming introduced by
The name test_sqs_route_keep_message_translator does not conform to the function naming conventions ([a-z_][a-z0-9_]{2,30}$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
16
    route = SQSRoute('what', handler='ever', message_translator=mock.Mock())
17
    assert isinstance(route.message_translator, mock.Mock)
0 ignored issues
show
Bug introduced by
The Instance of SQSRoute does not seem to have a member named message_translator.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
18
19
20
def test_sqs_route_keep_name():
21
    route = SQSRoute('what', handler='ever', name='foobar')
22
    assert route.name == 'foobar'
0 ignored issues
show
Bug introduced by
The Instance of SQSRoute does not seem to have a member named name.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
23
24
25
def test_sns_queue_route():
26
    route = SNSQueueRoute('what', handler='ever')
27
    assert isinstance(route.message_translator, SNSMessageTranslator)
0 ignored issues
show
Bug introduced by
The Instance of SNSQueueRoute does not seem to have a member named message_translator.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
28
    assert isinstance(route.provider, SQSProvider)
0 ignored issues
show
Bug introduced by
The Instance of SNSQueueRoute does not seem to have a member named provider.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
29
    assert route.name == 'what'
0 ignored issues
show
Bug introduced by
The Instance of SNSQueueRoute does not seem to have a member named name.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
30
31
32
def test_sns_queue_route_keep_message_translator():
0 ignored issues
show
Coding Style Naming introduced by
The name test_sns_queue_route_keep_message_translator does not conform to the function naming conventions ([a-z_][a-z0-9_]{2,30}$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
33
    route = SNSQueueRoute('what', handler='ever', message_translator=mock.Mock())
34
    assert isinstance(route.message_translator, mock.Mock)
0 ignored issues
show
Bug introduced by
The Instance of SNSQueueRoute does not seem to have a member named message_translator.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
35
36
37
def test_sns_queue_route_keep_name():
38
    route = SNSQueueRoute('what', handler='ever', name='foobar')
39
    assert route.name == 'foobar'
0 ignored issues
show
Bug introduced by
The Instance of SNSQueueRoute does not seem to have a member named name.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
40