def setUp(self): self.mock_file = MagicMock() # type: Union[BufferedReader, MagicMock] self.mock_file.read = MagicMock(side_effect=[b'\x84', b'\x18', b'\x00', b'\x3C']) # type: MagicMock