~hazmat/pyjuju/lxc-killpid

« back to all changes in this revision

Viewing changes to juju/control/tests/test_ssh.py

Removes duplicate stderr direct output on the cli

Also fixed many tests which relied on it.

A=therve
R=hazmat

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
import logging
2
2
import os
3
3
 
4
 
from yaml import dump
5
 
 
6
4
from twisted.internet.defer import inlineCallbacks, succeed, Deferred
7
5
 
8
6
from juju.environment.environment import Environment
45
43
        self.output = self.capture_logging(
46
44
            "juju.control.cli", level=logging.INFO)
47
45
 
48
 
        self.stderr = self.capture_stream("stderr")
49
 
 
50
46
    @inlineCallbacks
51
47
    def test_shell_with_unit(self):
52
48
        """
349
345
 
350
346
        self.assertIn(
351
347
            "Service unit 'mysql/1' is not assigned to a machine",
352
 
            self.stderr.getvalue())
 
348
            self.output.getvalue())
353
349
 
354
350
    @inlineCallbacks
355
351
    def test_shell_with_invalid_machine(self):
365
361
        main(["ssh", "1"])
366
362
        yield finished
367
363
 
368
 
        self.assertIn("Machine 1 was not found", self.stderr.getvalue())
 
364
        self.assertIn("Machine 1 was not found", self.output.getvalue())
369
365
 
370
366
 
371
367
class ParseErrorsTest(ServiceStateManagerTestBase, ControlToolTest):