コード例 #1
0
ファイル: test_danmu.py プロジェクト: ethanluoyc/yechuandanmu
    def test_disapprove_danmaku(self):
        client = socketio.test_client(self._app, namespace='/check')
        self._post_valid_danmaku('test1')  # id should be 1
        assert Danmaku.get_by_id(1).status == STATUS_FLAGS['waiting']

        msgs = client.get_received('/check')

        dmk = msgs[0]['args'][0]
        client.emit('disprove danmu', dmk, json=True, namespace='/check')
        assert Danmaku.get_by_id(1).status == STATUS_FLAGS['disproved']
コード例 #2
0
ファイル: test_danmu.py プロジェクト: ethanluoyc/yechuandanmu
    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']