<s> from unittest import TestCase <EOL> from mock import MagicMock <EOL> from graphitepager . notifiers . notifier_proxy import NotifierProxy <EOL> from graphitepager . notifiers . pagerduty_notifier import PagerdutyNotifier <EOL> class TestNotifierProxy ( TestCase ) : <EOL> def setUp ( self ) : <EOL> self . proxy = NotifierProxy ( ) <EOL> def test_adding_notifier ( self ) : <EOL> args = range ( <NUM_LIT:5> ) <EOL> notifier = MagicMock ( PagerdutyNotifier ) <EOL> self . proxy . add_notifier ( notifier ) <EOL> self . proxy . notify ( * args ) <EOL> notifier . notify . assert_called_once_with ( * args ) <EOL> def test_adding_multiple_notifiers ( self ) : <EOL> args = range ( <NUM_LIT:5> ) <EOL> notifier_1 = MagicMock ( PagerdutyNotifier ) <EOL> notifier_2 = MagicMock ( PagerdutyNotifier ) <EOL> self . proxy . add_notifier ( notifier_1 ) <EOL> self . proxy . add_notifier ( notifier_2 ) <EOL> self . proxy . notify ( * args ) <EOL> notifier_1 . notify . assert_called_once_with ( * args ) <EOL> notifier_2 . notify . assert_called_once_with ( * args ) </s>
