'When C{logfile} contains a file name, L{app.AppLogger._getLogObserver}
returns a log observer pointing at the specified path, and a signal
handler rotating the log is installed.'

def test_getLogObserverFile(self):

    logFiles = _patchTextFileLogObserver(self.patch)
    filename = self.mktemp()
    logger = UnixAppLogger({'logfile': filename})
    logger._getLogObserver()
    self.assertEqual(len(logFiles), 1)
    self.assertEqual(logFiles[0].path, os.path.abspath(filename))
    self.assertEqual(len(self.signals), 1)
    self.assertEqual(self.signals[0][0], signal.SIGUSR1)
    d = Deferred()
    def rotate():
        d.callback(None)
    logFiles[0].rotate = rotate
    rotateLog = self.signals[0][1]
    rotateLog(None, None)
    return d
