コード例 #1
0
ファイル: helpers.py プロジェクト: alitalia/GlobaLeaks
    def setUp(self):
        GLSettings.set_devel_mode()
        GLSettings.logging = None
        GLSettings.scheduler_threadpool = FakeThreadPool()
        GLSettings.sessions = {}
        GLSettings.failed_login_attempts = 0

        if os.path.isdir('/dev/shm'):
            GLSettings.working_path = '/dev/shm/globaleaks'
            GLSettings.ramdisk_path = '/dev/shm/globaleaks/ramdisk'
        else:
            GLSettings.working_path = './working_path'
            GLSettings.ramdisk_path = './working_path/ramdisk'

        GLSettings.eval_paths()
        GLSettings.remove_directories()
        GLSettings.create_directories()

        self.setUp_dummy()

        yield db.create_tables(self.create_node)

        for fixture in getattr(self, 'fixtures', []):
            yield import_fixture(fixture)

        yield import_memory_variables()

        # override of imported memory variables
        GLSettings.memory_copy.allow_unencrypted = True

        anomaly.Alarm.reset()
        event.EventTrackQueue.reset()
        statistics_sched.StatisticsSchedule.reset()

        self.internationalized_text = load_appdata()['node']['whistleblowing_button']
コード例 #2
0
def init_glsettings_for_unit_tests():
    GLSettings.testing = True
    GLSettings.set_devel_mode()
    GLSettings.logging = None
    GLSettings.scheduler_threadpool = FakeThreadPool()
    GLSettings.sessions.clear()
    GLSettings.failed_login_attempts = 0
    GLSettings.working_path = './working_path'
    GLSettings.ramdisk_path = os.path.join(GLSettings.working_path, 'ramdisk')

    GLSettings.eval_paths()
    GLSettings.remove_directories()
    GLSettings.create_directories()
コード例 #3
0
ファイル: helpers.py プロジェクト: jpobley/GlobaLeaks
def init_glsettings_for_unit_tests():
    GLSettings.testing = True
    GLSettings.set_devel_mode()
    GLSettings.logging = None
    GLSettings.scheduler_threadpool = FakeThreadPool()
    GLSettings.sessions.clear()
    GLSettings.failed_login_attempts = 0
    GLSettings.working_path = './working_path'
    GLSettings.ramdisk_path = os.path.join(GLSettings.working_path, 'ramdisk')

    GLSettings.eval_paths()
    GLSettings.remove_directories()
    GLSettings.create_directories()
コード例 #4
0
ファイル: helpers.py プロジェクト: adolfoeliazat/GlobaLeaks
def init_glsettings_for_unit_tests():
    GLSettings.testing = True
    GLSettings.set_devel_mode()
    GLSettings.logging = None
    GLSettings.failed_login_attempts = 0
    GLSettings.working_path = './working_path'

    GLSettings.eval_paths()

    GLSettings.set_ramdisk_path()

    GLSettings.remove_directories()
    GLSettings.create_directories()

    GLSettings.orm_tp = FakeThreadPool()

    GLSessions.clear()
コード例 #5
0
def init_glsettings_for_unit_tests():
    GLSettings.testing = True
    GLSettings.set_devel_mode()
    GLSettings.logging = None
    GLSettings.failed_login_attempts = 0
    GLSettings.working_path = './working_path'
    GLSettings.onionservice = 'kpvz7ki2v5agwt35.onion'

    GLSettings.eval_paths()

    GLSettings.set_ramdisk_path()

    GLSettings.remove_directories()
    GLSettings.create_directories()

    GLSettings.orm_tp = FakeThreadPool()

    GLSettings.memory_copy.hostname = 'localhost'

    GLSessions.clear()