def testReplaceFilenames(self):
        file_contents = """
[global]
blocksize = 4k
filename = zanzibar
ioengine=libaio

[job1]
filename = asdf
blocksize = 8k
"""

        jobfile = fio_benchmark.ProcessedJobFileString(file_contents, True)
        self.assertNotIn('filename', jobfile)
        self.assertNotIn('zanzibar', jobfile)
        self.assertNotIn('asdf', jobfile)
Beispiel #2
0
  def testReplaceFilenames(self):
    file_contents = """
[global]
blocksize = 4k
filename = zanzibar
ioengine=libaio

[job1]
filename = asdf
blocksize = 8k
"""

    open_mock = mock.MagicMock()
    manager = open_mock.return_value.__enter__.return_value
    manager.read.return_value = file_contents
    manager.__exit__.return_value = mock.Mock()

    with mock.patch('__builtin__.open', open_mock):
      jobfile = fio_benchmark.ProcessedJobFileString('filename', True)
      self.assertNotIn('filename', jobfile)
      self.assertNotIn('zanzibar', jobfile)
      self.assertNotIn('asdf', jobfile)