~frankban/juju-gui/quickstart-real-bootstrap

« back to all changes in this revision

Viewing changes to quickstart/tests/helpers.py

  • Committer: Francesco Banconi
  • Date: 2013-10-15 17:33:10 UTC
  • Revision ID: francesco.banconi@canonical.com-20131015173310-qt2pq83kttj5nial
Implemented the main app functions.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
import os
21
21
import tempfile
22
22
 
 
23
import mock
23
24
import yaml
24
25
 
25
26
 
58
59
        env_file.write(contents)
59
60
        env_file.close()
60
61
        return env_file.name
 
62
 
 
63
 
 
64
class CallTestsMixin(object):
 
65
    """Easily use the quickstart.utils.call function."""
 
66
 
 
67
    def patch_call(self, retcode, output='', error=''):
 
68
        """Patch the quickstart.utils.call function."""
 
69
        mock_call = mock.Mock(return_value=(retcode, output, error))
 
70
        return mock.patch('quickstart.utils.call', mock_call)