for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
# -*- coding: utf-8 -*-
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.
import os
os
import re
re
from tracim.lib.core.notifications import DummyNotifier
from tracim.lib.core.notifications import EmailNotifier
from tracim.lib.core.notifications import NotifierFactory
from tracim.models.auth import User
from tracim.models.data import Content
from tracim.tests import DefaultTest
from tracim.tests import eq_
class TestDummyNotifier(DefaultTest):
__class__
def test_dummy_notifier__notify_content_update(self):
test_dummy_notifier__notify_content_update
(([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.
c = Content()
c
notifier = DummyNotifier(self.app_config)
notifier.notify_content_update(c)
# INFO - D.A. - 2014-12-09 -
# Old notification_content_update raised an exception
class TestNotifierFactory(DefaultTest):
def test_notifier_factory_method(self):
u = User()
u
self.app_config.EMAIL_NOTIFICATION_ACTIVATED = True
notifier = NotifierFactory.create(self.app_config, u)
eq_(EmailNotifier, notifier.__class__)
self.app_config.EMAIL_NOTIFICATION_ACTIVATED = False
eq_(DummyNotifier, notifier.__class__)
class TestEmailNotifier(DefaultTest):
# TODO - G.M - 04-03-2017 - [emailNotif] - Restore test for email Notif
TODO
FIXME
pass
The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.