Convert snapshot_export rpc to new style
[ganeti-local] / test / ganeti.ssh_unittest.py
index ac5821e..d999929 100755 (executable)
@@ -37,14 +37,14 @@ class TestKnownHosts(testutils.GanetiTestCase):
   """Test case for function writing the known_hosts file"""
 
   def setUp(self):
-    self.tmpfile = tempfile.NamedTemporaryFile()
+    testutils.GanetiTestCase.setUp(self)
+    self.tmpfile = self._CreateTempFile()
 
   def test(self):
     cfg = mocks.FakeConfig()
-    sstore = mocks.FakeSStore()
-    ssh.WriteKnownHostsFile(cfg, sstore, self.tmpfile.name)
-    self.assertFileContent(self.tmpfile.name,
-        "%s ssh-rsa %s\n" % (sstore.GetClusterName(),
+    ssh.WriteKnownHostsFile(cfg, self.tmpfile)
+    self.assertFileContent(self.tmpfile,
+        "%s ssh-rsa %s\n" % (cfg.GetClusterName(),
                              mocks.FAKE_CLUSTER_KEY))