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
def test_int_as_address(self): with pytest.raises(TypeError): pusher.Switch("hostname", 1234)
def test_int_as_hostname(self): with pytest.raises(TypeError): pusher.Switch(1, "test.local")
def switch(self): return pusher.Switch("TEST_HOSTNAME", "hostname.local")
def switch_with_fake_conn(self): pusher.ConnectHandler = Mock() o = pusher.Switch("TEST_HOSTNAME", "hostname.local") o.createSSHConnection("test", "test") return o