Beispiel #1
0
	def test_orderby4(self):
		test = True
		ppl = self.uv.test.find(Document.orderby())
		# print
		prev = ''
		for person in ppl:
			# print person.name, person.age, person.college
			if str(person) < prev:
				test = False
			prev = str(person)
Beispiel #2
0
	def test_orderby2(self):
		test = True
		# print type(self.uv.test.find())
		ppl = self.uv.test.find(Document.orderby('-age'))
		age = 100
		for person in ppl:
			if person.age > age:
				test = False
			age = person.age
		
		self.assertTrue(test)
Beispiel #3
0
	def test_orderby(self):
		test = True
		ppl = self.uv.test.find(Document.orderby('age'))
	
		age = -1
		for person in ppl:
			if person.age < age:
				test = False
			age = person.age
		
		self.assertTrue(test)
Beispiel #4
0
	def test_orderby3(self):
		test = True
		ppl = self.uv.test.find(Document.orderby('name','-age', 'college'))
		# print
		age = 100
		name = 'aa'
		for person in ppl:
			# print person.name, person.age, person.college
			if person.name < name:
				test = False
			if person.name != name:
				age = 100
			if person.age > age:
				test = False
			age = person.age
Beispiel #5
0
	def test_find_skip(self):
		self.test = self.uv.test
		length = len(list(self.test))
		results = self.test.find(Document.skip(5))
		self.assertTrue(len(list(results)) == length - 5)
Beispiel #6
0
	def test_find_limit(self):
		self.test = self.uv.test
		# length = len(list(self.test))
		results = self.test.find(Document.limit(5))
		self.assertTrue(len(list(results)) == 5)