Esempio 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
Esempio n. 2
0
 def test_int_as_address(self):
     with pytest.raises(TypeError):
         pusher.Switch("hostname", 1234)
Esempio n. 3
0
 def test_int_as_hostname(self):
     with pytest.raises(TypeError):
         pusher.Switch(1, "test.local")
Esempio n. 4
0
 def switch(self):
     return pusher.Switch("TEST_HOSTNAME", "hostname.local")
Esempio 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