Ejemplo n.º 1
0
 def switch_with_fake_data(self):
     pusher.ConnectHandler = Mock()
     o = pusher.Switch("TEST_HOSTNAME", "hostname.local")
     o.createSSHConnection("test", "test")
     o.conn.send_command = Mock(side_effect=self.mock_send_command)
     o.gatherFacts()
     return o
Ejemplo n.º 2
0
 def test_int_as_address(self):
     with pytest.raises(TypeError):
         pusher.Switch("hostname", 1234)
Ejemplo n.º 3
0
 def test_int_as_hostname(self):
     with pytest.raises(TypeError):
         pusher.Switch(1, "test.local")
Ejemplo n.º 4
0
 def switch(self):
     return pusher.Switch("TEST_HOSTNAME", "hostname.local")
Ejemplo n.º 5
0
 def switch_with_fake_conn(self):
     pusher.ConnectHandler = Mock()
     o = pusher.Switch("TEST_HOSTNAME", "hostname.local")
     o.createSSHConnection("test", "test")
     return o