MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_sha256

Method test_sha256

Lib/test/test_socket.py:7008–7023  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

7006 @unittest.expectedFailure # TODO: RUSTPYTHON; - AF_ALG not fully implemented
7007 @support.requires_linux_version(4, 5)
7008 def test_sha256(self):
7009 expected = bytes.fromhex("ba7816bf8f01cfea414140de5dae2223b00361a396"
7010 "177a9cb410ff61f20015ad")
7011 with self.create_alg('hash', 'sha256') as algo:
7012 op, _ = algo.accept()
7013 with op:
7014 op.sendall(b"abc")
7015 self.assertEqual(op.recv(512), expected)
7016
7017 op, _ = algo.accept()
7018 with op:
7019 op.send(b'a', socket.MSG_MORE)
7020 op.send(b'b', socket.MSG_MORE)
7021 op.send(b'c', socket.MSG_MORE)
7022 op.send(b'')
7023 self.assertEqual(op.recv(512), expected)
7024
7025 @unittest.expectedFailure # TODO: RUSTPYTHON; - AF_ALG not fully implemented
7026 def test_hmac_sha1(self):

Callers

nothing calls this directly

Calls 7

create_algMethod · 0.95
fromhexMethod · 0.45
acceptMethod · 0.45
sendallMethod · 0.45
assertEqualMethod · 0.45
recvMethod · 0.45
sendMethod · 0.45

Tested by

no test coverage detected