Esempio n. 1
0
    def test_bypass_with_supervise_off(self):
        # Feature flag should be toggled
        client = socketio.test_client(self._app, namespace='/check')
        FeatureFlag.toggle_flag('supervise', status=False)
        assert FeatureFlag.get_flag('supervise').status == False

        self._post_valid_danmaku('test1')  # id should be 1
        assert Danmaku.get_by_id(1).status == STATUS_FLAGS['approved']
Esempio n. 2
0
def supervise(status):
    if not status:
        status = 'on' if FeatureFlag.toggle_flag('supervise') else 'off'
    else:
        if status == 'on':
            f = True
        elif status == 'off':
            f = False
        status = FeatureFlag.toggle_flag('supervise', f)
    print('Supervise is now turned {0}'.format(status))