Exemplo n.º 1
0
	def test_insertBeforeMulti_updateOnExist(self):
		set_ = OrderedSet("efdg")
		set_.insertMultiBefore(("e","f"), "g", updateOnExist=False)
		self.assertEqual(set_, OrderedSet("efdg"), "Set changed on multiple insert when updateOnExist=False")
		
		set_ = OrderedSet("edg")
		set_.insertMultiBefore(("e","f"), "g", updateOnExist=False)
		self.assertEqual(set_, OrderedSet("edfg"), "Incorrect set with multiple insert where some elements already exist")
Exemplo n.º 2
0
	def test_insertBeforeMulti(self):
		set_ = OrderedSet("dgi")
		set_.insertMultiBefore("h", "i", updateOnExist=True)
		self.assertEqual(set_, OrderedSet("dghi"), "Failed to insert a single element using insertMultiBefore")
		
		set_.insertMultiBefore(("e","f"), "g", updateOnExist=True)
		self.assertEqual(set_, OrderedSet("defghi"), "Failed to insert multiple elements in the set")
		
		set_.insertMultiBefore(("a","b","c"), "d", updateOnExist=True)
		self.assertEqual(set_, OrderedSet("abcdefghi"), "Failed to insert multiple elements before the first element in the set")