コード例 #1
0
    def setUp(self):
        yield helpers.TestGL.setUp(self)

        pollute_events_for_testing()
        yield Alarm.compute_activity_level()

        # Token submission
        st = Token('submission')
        st.generate_token_challenge()
コード例 #2
0
ファイル: test_token.py プロジェクト: comradekingu/GlobaLeaks
    def setUp(self):
        yield helpers.TestGL.setUp(self)

        pollute_events_for_testing()
        yield Alarm.compute_activity_level()

        # Token submission
        st = Token('submission')
        st.generate_token_challenge()
コード例 #3
0
ファイル: test_token.py プロジェクト: br1n0/GlobaLeaks
    def setUp(self):
        yield helpers.TestGL.setUp(self)

        # This is at the beginning
        event.EventTrackQueue.reset()

        pollute_events_for_testing()
        yield anomaly.compute_activity_level()

        # Token submission
        st = Token('submission')
        st.generate_token_challenge()
コード例 #4
0
ファイル: test_token.py プロジェクト: nyimbi/GlobaLeaks
    def setUp(self):
        yield helpers.TestGL.setUp(self)

        # This is at the beginning
        event.EventTrackQueue.reset()

        pollute_events_for_testing()
        yield anomaly.compute_activity_level()

        # Token submission
        st = Token('submission')
        st.generate_token_challenge()
コード例 #5
0
    def test_proof_of_work_right_answer(self):
        token = Token('submission')

        difficulty = {
            'human_captcha': False,
            'proof_of_work': False
        }

        token.generate_token_challenge(difficulty)

        token = TokenList.get(token.id)
        # Note, this solution works with two '00' at the end, if the
        # difficulty changes, also this dummy value has to.
        token.proof_of_work = {'question': "7GJ4Sl37AEnP10Zk9p7q"}

        # validate with right value: OK
        self.assertTrue(token.update({'proof_of_work_answer': 0}))
コード例 #6
0
ファイル: test_token.py プロジェクト: jpobley/GlobaLeaks
    def test_proof_of_work_right_answer(self):
        token = Token('submission')

        difficulty = {
            'human_captcha': False,
            'graph_captcha': False,
            'proof_of_work': False
        }

        token.generate_token_challenge(difficulty)

        token = TokenList.get(token.id)
        # Note, this solution works with two '00' at the end, if the
        # difficulty changes, also this dummy value has to.
        token.proof_of_work = { 'question': "7GJ4Sl37AEnP10Zk9p7q" }

        # validate with right value: OK
        self.assertTrue(token.update({'proof_of_work_answer': 0}))
コード例 #7
0
ファイル: test_token.py プロジェクト: br1n0/GlobaLeaks
    def test_proof_of_work_right_answer(self):
        # This is at the beginning
        event.EventTrackQueue.reset()

        token = Token('submission')

        difficulty = {
            'human_captcha': False,
            'graph_captcha': False,
            'proof_of_work': False
        }

        token.generate_token_challenge(difficulty)

        token = TokenList.get(token.id)
        # Note, this solution works with two '00' at the end, if the
        # difficulty changes, also this dummy value has to.
        token.proof_of_work = { 'question': "7GJ4Sl37AEnP10Zk9p7q" }

        # validate with right value: OK
        self.assertFalse(token.update({'proof_of_work_answer': 26}))

        # verify that the challenge is marked as solved
        self.assertFalse(token.proof_of_work)
コード例 #8
0
ファイル: test_token.py プロジェクト: nyimbi/GlobaLeaks
    def test_proof_of_work_right_answer(self):
        # This is at the beginning
        event.EventTrackQueue.reset()

        token = Token('submission')

        difficulty = {
            'human_captcha': False,
            'graph_captcha': False,
            'proof_of_work': False
        }

        token.generate_token_challenge(difficulty)

        token = TokenList.get(token.id)
        # Note, this solution works with two '00' at the end, if the
        # difficulty changes, also this dummy value has to.
        token.proof_of_work = {'question': "7GJ4Sl37AEnP10Zk9p7q"}

        # validate with right value: OK
        self.assertFalse(token.update({'proof_of_work_answer': 26}))

        # verify that the challenge is marked as solved
        self.assertFalse(token.proof_of_work)