#!/usr/bin/env python
# -*- coding: utf-8 -*-

from unittest import TestCase
from mock import patch

from gaius import cli


class CliTests(TestCase):

    @patch('gaius.service.receive')
    @patch('gaius.service.notify')
    @patch('docopt.docopt')
    def test_should_communicate(self, mock_docopt, mock_notify, mock_receive):
        parameters = [
            '--stack=mystack',
            '--parameters=parameter1=value1,parameter2=value2',
            '--topic-arn=my::topic::arn',
            '--region=eu-west-1',
            '--back-channel=crassus-output'
        ]
        mock_docopt.return_value = parameters
        cli.communicate()

@@ -228,22 +228,25 @@
 @patch('
-docopt
+gaius.cli
 .docopt'
@@ -351,9 +351,9 @@
 s = 
-%5B
+%7B
 %0A   
@@ -369,17 +369,20 @@
 '--stack
-=
+': '
 mystack'
@@ -408,17 +408,20 @@
 rameters
-=
+': '
 paramete
@@ -474,17 +474,20 @@
 opic-arn
-=
+': '
 my::topi
@@ -516,17 +516,20 @@
 --region
-=
+': '
 eu-west-
@@ -559,17 +559,20 @@
 -channel
-=
+': '
 crassus-
@@ -591,9 +591,9 @@
     
-%5D
+%7D
 %0A   
@@ -661,8 +661,284 @@
 icate()%0A
+        mock_notify.assert_called_once_with('mystack',%0A                                            'parameter1=value1,parameter2=value2',%0A                                            'my::topic::arn', 'eu-west-1')%0A        mock_receive.assert_called_once_with('crassus-output')%0A

fix the cli tests