def testMkstempDir(self):
    # expect fail: /dir does not exist
    self.assertRaises(OSError, self.tempfile.mkstemp, dir='/dir')
    # expect pass: /dir exists
    self.filesystem.CreateDirectory('/dir')
    next_fd = len(self.filesystem.open_files)
    temporary = self.tempfile.mkstemp(dir='/dir')
    self.assertEqual(2, len(temporary))
    self.assertEqual(next_fd, temporary[0])
    self.assertTrue(temporary[1].startswith('/dir/tmp'))
    created_filenames = self.tempfile.FakeReturnedMktempValues()
    self.assertEqual(temporary[1], created_filenames[0])
    self.assertTrue(self.filesystem.Exists(temporary[1]))
    self.assertEqual(self.filesystem.GetObject(temporary[1]).st_mode,
                     stat.S_IFREG|0o600)
    # pylint: disable-msg=C6002
    # TODO: add a test that /dir is actually writable.
Set the minimal score improvement per move for balancing steps
dataset/ETHPy150Open jmcgeheeiv/pyfakefs/fake_tempfile_test.py/FakeTempfileModuleTest.testMkstempDir--crossover with--dataset/ETHPy150Open ganeti/ganeti/lib/config/__init__.py/ConfigWriter.SetMaintdBalanceThreshold