Пример #1
0
    def test_non_matching_digests_should_return_false(self):
        secret = 'secrettoken'
        message = 'message blah blah horse battery staple'
        Secret.set(secret)
        digest_received = Secret._get_hex_digest('not the original message', secret)

        self.assertFalse(Secret.digest_is_valid(digest_received, message))
Пример #2
0
    def test_matching_digests_should_return_true(self):
        secret = 'secrettoken'
        message = 'message blah blah horse battery staple'
        Secret.set(secret)
        digest_received = Secret._get_hex_digest(message, secret)

        self.assertTrue(Secret.digest_is_valid(digest_received, message))
Пример #3
0
    def test_matching_digests_should_return_true(self):
        secret = 'secrettoken'
        message = 'message blah blah horse battery staple'
        Secret.set(secret)
        digest_received = Secret._get_hex_digest(message, secret)

        self.assertTrue(Secret.digest_is_valid(digest_received, message))
Пример #4
0
    def test_non_matching_digests_should_return_false(self):
        secret = 'secrettoken'
        message = 'message blah blah horse battery staple'
        Secret.set(secret)
        digest_received = Secret._get_hex_digest('not the original message', secret)

        self.assertFalse(Secret.digest_is_valid(digest_received, message))