5"""Tests for emitter module."""
22 """Verifies that the multiemitter contains the expected contents.
24 Expected is a list of (filename, content) pairs, sorted by filename.
28 def _Collect(file, contents):
29 files.append((file,
''.
join(contents)))
32 self.assertEqual(expected, files)
36 e1 = m.FileEmitter(
'file1')
37 e2 = m.FileEmitter(
'file2',
'key2')
40 m.Find(
'key2').Emit(
'Bye 2')
41 self.
check(m, [(
'file1',
'Hi 1'), (
'file2',
'Hi 2Bye 2')])
44if __name__ ==
'__main__':
45 logging.config.fileConfig(
'logging.conf')
46 if __name__ ==
'__main__':
def check(self, m, expected)
static SkString join(const CommandLineFlags::StringArray &)