def test_invalid_cloning(self): window = BufferContentWindow(1, b'abcd') with self.assertRaises(AssertionError): window.clone(1, 5) with self.assertRaises(AssertionError): window.clone(0, 1) with self.assertRaises(AssertionError): window.clone(5, 1)
def test_cloning(self): window1 = BufferContentWindow(1, b'abcd') window2 = window1.clone(2, 3) self.assertEqual(window2.get(2, 3), b'bcd')