'Verify that observer performs an expected number of writes when the
formatter returns a given value.
@param what: the value for the formatter to return.
@type what: L{unicode}
@param count: the expected number of writes.
@type count: L{int}'

def _test_observeWrites(self, what, count):

    with DummyFile() as fileHandle:
        observer = FileLogObserver(fileHandle, (lambda e: what))
        event = dict(x=1)
        observer(event)
        self.assertEqual(fileHandle.writes, count)
