import dnot
from mock import patch
import unittest2


class NotifierTest(unittest2.TestCase):
    @patch("dnot.boto.sns.connect_to_region")
    def test_parameters_are_submitted(self, connect_to_region_mock):
        topic = "abc"
        region = "eu-west-2"
        notifier = dnot.Notifier(sns_region=region)

        notifier.publish(sns_topic_arn=topic, stack_name="stack1", params='{ "key": "value" }')

        connect_to_region_mock.assert_called_with(region)
        connect_to_region_mock.return_value.publish.assert_called_with(
            topic=topic,
            message='{"stackName": "stack1", "region": "eu-west-1", "params": {"key": "value"}}')

@@ -253,16 +253,115 @@
 west-2%22%0A
+        result_topic = %22result%22%0A        stack_name = %22stack1%22%0A        params = '%7B%22key%22: %22value%22%7D'%0A%0A
         
@@ -404,17 +404,16 @@
 region)%0A
-%0A
         
@@ -465,45 +465,60 @@
 ame=
-%22
 stack
-1%22, params='%7B %22key%22: %22value%22 %7D'
+_name, result_topic=result_topic, params=params
 )%0A%0A 
@@ -693,16 +693,17 @@
 ssage='%7B
+%7B
 %22stackNa
@@ -708,22 +708,45 @@
 Name%22: %22
-stack1
+%7B0%7D%22, %22notificationARN%22: %22%7B1%7D
 %22, %22regi
@@ -778,23 +778,101 @@
 %22: %7B
-%22key%22: %22value%22%7D%7D'
+2%7D%7D%7D'.format(%0A                stack_name,%0A                result_topic,%0A                params)
 )%0A

fix tests