MCPcopy Index your code
hub / github.com/python/cpython / test_read_write

Method test_read_write

Lib/test/test_ssl.py:1948–1960  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1946class MemoryBIOTests(unittest.TestCase):
1947
1948 def test_read_write(self):
1949 bio = ssl.MemoryBIO()
1950 bio.write(b'foo')
1951 self.assertEqual(bio.read(), b'foo')
1952 self.assertEqual(bio.read(), b'')
1953 bio.write(b'foo')
1954 bio.write(b'bar')
1955 self.assertEqual(bio.read(), b'foobar')
1956 self.assertEqual(bio.read(), b'')
1957 bio.write(b'baz')
1958 self.assertEqual(bio.read(2), b'ba')
1959 self.assertEqual(bio.read(1), b'z')
1960 self.assertEqual(bio.read(1), b'')
1961
1962 def test_eof(self):
1963 bio = ssl.MemoryBIO()

Callers

nothing calls this directly

Calls 3

writeMethod · 0.45
assertEqualMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected