def test_write_read(self): thing = Thing() p = Pipe() p.put(thing) read = p.reader.get() p.close() self.assertEqual(read, thing)
def test_multiple_write_read(self): things = [Thing(), Thing(), Thing()] p = Pipe() for t in things: p.put(t) read = [] for _ in things: read.append(p.reader.get()) p.close() self.assertEqual(read, things)
def test_multiple_write_read(self): things = [ Thing(), Thing(), Thing() ] p = Pipe() for t in things: p.put(t) read = [] for _ in things: read.append(p.reader.get()) p.close() self.assertEqual(read, things)
def test_put(self, _open): _open.return_value = Mock(), Mock() thing = Thing() p = Pipe() p.put(thing) _open.return_value[1].put.assert_called_once_with(thing)