TestDummyNotifier.test_dummy_notifier__notify_content_update()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 4
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
# -*- coding: utf-8 -*-
0 ignored issues
show
Coding Style introduced by
This module should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
2
import os
0 ignored issues
show
Unused Code introduced by
The import os seems to be unused.
Loading history...
3
import re
0 ignored issues
show
Unused Code introduced by
The import re seems to be unused.
Loading history...
4
5
6
from tracim.lib.core.notifications import DummyNotifier
7
from tracim.lib.core.notifications import EmailNotifier
8
from tracim.lib.core.notifications import NotifierFactory
9
from tracim.models.auth import User
10
from tracim.models.data import Content
11
from tracim.tests import DefaultTest
12
from tracim.tests import eq_
13
14
class TestDummyNotifier(DefaultTest):
0 ignored issues
show
Coding Style introduced by
This class should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
Unused Code introduced by
The variable __class__ seems to be unused.
Loading history...
15
16
    def test_dummy_notifier__notify_content_update(self):
0 ignored issues
show
Coding Style Naming introduced by
The name test_dummy_notifier__notify_content_update does not conform to the method naming conventions ((([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$).

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...
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
17
        c = Content()
0 ignored issues
show
Coding Style Naming introduced by
The name c does not conform to the variable naming conventions ((([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$).

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...
18
        notifier = DummyNotifier(self.app_config)
19
        notifier.notify_content_update(c)
20
        # INFO - D.A. - 2014-12-09 -
21
        # Old notification_content_update raised an exception
22
23
24
class TestNotifierFactory(DefaultTest):
0 ignored issues
show
Coding Style introduced by
This class should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
Unused Code introduced by
The variable __class__ seems to be unused.
Loading history...
25
    def test_notifier_factory_method(self):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
26
        u = User()
0 ignored issues
show
Coding Style Naming introduced by
The name u does not conform to the variable naming conventions ((([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$).

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...
27
28
        self.app_config.EMAIL_NOTIFICATION_ACTIVATED = True
29
        notifier = NotifierFactory.create(self.app_config, u)
30
        eq_(EmailNotifier, notifier.__class__)
31
32
        self.app_config.EMAIL_NOTIFICATION_ACTIVATED = False
33
        notifier = NotifierFactory.create(self.app_config, u)
34
        eq_(DummyNotifier, notifier.__class__)
35
36
37
class TestEmailNotifier(DefaultTest):
0 ignored issues
show
Coding Style introduced by
This class should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
38
    # TODO - G.M - 04-03-2017 -  [emailNotif] - Restore test for email Notif
0 ignored issues
show
Coding Style introduced by
TODO and FIXME comments should generally be avoided.
Loading history...
39
    pass
40