'Verify that the pid file succeeds and fails appropriately'

def testGoodPidFile(self):

    pid_dir = tempfile.mkdtemp()
    program = 'test'
    expected_path = os.path.join(pid_dir, ('%s.pid' % program))
    pid = '666'
    pid_f = open(expected_path, 'w')
    pid_f.write(pid)
    pid_f.close()
    p = PidFile(program, pid_dir)
    self.assertEquals(p.get_pid(), 666)
    self.assertEquals(p.clean(), True)
    self.assertEquals(os.path.exists(expected_path), False)
