~1chb1n/mojo/venv-friendly

« back to all changes in this revision

Viewing changes to mojo/tests/test_juju1.py

[pjdc,r=mthaddon] add command_timeout to Juju1Status and Jujus2Status, and use it for juju-parse-status; lp#1641471

Show diffs side-by-side

added added

removed removed

Lines of Context:
208
208
            no_env_status = mojo.juju.status.Juju1Status()
209
209
            no_env_status._get_status()
210
210
            mock_check_output.assert_called_with(
211
 
                ['juju', 'status', '--format=yaml'])
 
211
                ['/usr/bin/timeout', '--kill-after', '5', '600',
 
212
                 'juju', 'status', '--format=yaml'])
212
213
            # Second test with an environment set
213
214
            env_status = mojo.juju.status.Juju1Status(environment="test-env")
214
215
            env_status._get_status()
215
216
            mock_check_output.assert_called_with(
216
 
                ['juju', 'status', '--format=yaml', '-e', 'test-env'])
 
217
                ['/usr/bin/timeout', '--kill-after', '5', '600',
 
218
                 'juju', 'status', '--format=yaml', '-e', 'test-env'])
217
219
 
218
220
        with mock.patch('subprocess.check_output') as mock_check_output:
219
221
            # Check that if we're calling _get_status where _status_output is
225
227
            # called
226
228
            self.status._get_status(force_update=True)
227
229
            mock_check_output.assert_called_with(
228
 
                ['juju', 'status', '--format=yaml'])
 
230
                ['/usr/bin/timeout', '--kill-after', '5', '600',
 
231
                 'juju', 'status', '--format=yaml'])
229
232
 
230
233
    def test_yaml_status(self):
231
234
        """Test the yaml_status function"""