def testinsertNegative(self): a = PCSet(self.l, multiset=True) b = PSet(self.l, multiset=True) a.insert(-2, 2) b.insert(-3, 12) self.assertEqual(a.pitches, [1, 4, 23, 2, 5, -9]) self.assertEqual(b.pitches, [1, 4, 12, 23, 5, -9])
def testinsertAfter(self): a = PCSet(self.l) b = PSet(self.l) a.insert(100, 1) b.insert(100, 0) self.assertEqual(a.pitches, self.l + [1]) self.assertEqual(b.pitches, self.l + [0])
def testinsertMiddle(self): a = PCSet(self.l) b = PSet(self.l) a.insert(3, 15) b.insert(4, 8) self.assertEqual(a.pitches, [1, 4, 23, 15, 5, -9]) self.assertEqual(b.pitches, [1, 4, 23, 5, 8, -9])
def testinsertEnd(self): a = PCSet(self.l) b = PSet(self.l) a.insert(6, 10) b.insert(6, 99) self.assertEqual(a.pitches, self.l + [10]) self.assertEqual(b.pitches, self.l + [99])
def testinsertBegin(self): a = PCSet(self.l) b = PSet(self.l) a.insert(0, 10) b.insert(0, 11) self.assertEqual(a.pitches, [10] + self.l) self.assertEqual(b.pitches, [11] + self.l)