'Log level is emitted properly.'

def test_writeLevel(self):

    f = self.observedFile()
    f.write('Hello\n')
    self.assertEqual(len(f.events), 1)
    self.assertEqual(f.events[0]['log_level'], LogLevel.info)
    f = self.observedFile(level=LogLevel.error)
    f.write('Hello\n')
    self.assertEqual(len(f.events), 1)
    self.assertEqual(f.events[0]['log_level'], LogLevel.error)
