'Should write the current PID to the specified file.'

def test_writes_pid_to_file(self):

    pidfile_path = self.scenario['path']
    self.scenario['pidfile'].close = scaffold.Mock('PIDLockFile.close', tracker=self.mock_tracker)
    expect_line = ('%(pid)d\n' % self.scenario)
    pidlockfile.write_pid_to_pidfile(pidfile_path)
    scaffold.mock_restore()
    self.failUnlessEqual(expect_line, self.scenario['pidfile'].getvalue())
