def test_write(self): configs = SSHConfig(sample) configs.add(new_host) new_sample_path = os.path.join(os.path.dirname(__file__), "sample_new") configs.write(filename=new_sample_path) new_config = SSHConfig(new_sample_path) os.remove(new_sample_path) self.assertEqual("server2", new_config.get("server2").name)
def test_set_host(self): configs = SSHConfig(sample) configs.add(new_host) self.assertEqual(new_host, configs.hosts[-1])