'When the C{profile} module is not present, L{app.ProfilerRunner.run}
should raise a C{SystemExit} exception.'

def test_withoutProfile(self):

    savedModules = sys.modules.copy()
    config = twistd.ServerOptions()
    config['profiler'] = 'profile'
    profiler = app.AppProfiler(config)
    sys.modules['profile'] = None
    try:
        self.assertRaises(SystemExit, profiler.run, None)
    finally:
        sys.modules.clear()
        sys.modules.update(savedModules)
