Exemple #1
0
	def test_update_entry_correct_priority(self):
		ent = Entry('a','apple',5)	
		time.sleep(0.001)
		ent2 = Entry('b','cat',3)	
		self.lruc4._add_entry(ent)
		self.lruc4._add_entry(ent2)
		time.sleep(0.001)
		ent.touch()
		self.lruc4._update_entry(ent)
		smallest = heapq.heappop(self.lruc4._ordering)
		assert smallest == ent2
Exemple #2
0
	def test_touch(self):
		ent = Entry('a','apple',5)
		old_time = ent.epochtimestamp
		ent.touch()
		new_time = ent.epochtimestamp