Example #1
0
	def testListProjectUsers(self):
		colName = 'users'
		retClass = ProjectUser
		resp = self._rcol(colName, ['_id', 'username', 'first_name', 'last_name', 'avatar', 'email', 'created_at'])
		self._client.debugReturn = {'data': json.dumps(resp), 'status': 200}

		col = Project(self._client, {'id': 0}).users.all()

		self.assertEqual(resp[colName], col.toArray())
		self.assertIsInstance(col._collection[0], retClass)
		self.assertEqual(resp['meta']['pagination']['total'], col.total())
		self.assertEqual(resp['meta']['pagination']['total_pages'], col.totalPages())
		self.assertEqual(resp['meta']['pagination']['count'], col.count())
Example #2
0
	def testListProjectBugPriorityScheme(self):
		colName = 'scheme'
		retClass = ProjectBugScheme
		resp = self._rcol(colName, ['_id', 'name'])
		self._client.debugReturn = {'data': json.dumps(resp), 'status': 200}

		col = Project(self._client, {'id': 0}).bugPriorityScheme.all()

		self.assertEqual(resp[colName], col.toArray())
		self.assertIsInstance(col._collection[0], retClass)
		self.assertEqual(resp['meta']['pagination']['total'], col.total())
		self.assertEqual(resp['meta']['pagination']['total_pages'], col.totalPages())
		self.assertEqual(resp['meta']['pagination']['count'], col.count())
Example #3
0
	def testListProjectVersions(self):
		colName = 'versions'
		retClass = ProjectVersion
		resp = self._rcol(colName, ['_id', 'number', '_project_id'])
		self._client.debugReturn = {'data': json.dumps(resp), 'status': 200}

		col = Project(self._client, {'id': 0}).versions.all()

		self.assertEqual(resp[colName], col.toArray())
		self.assertIsInstance(col._collection[0], retClass)
		self.assertEqual(resp['meta']['pagination']['total'], col.total())
		self.assertEqual(resp['meta']['pagination']['total_pages'], col.totalPages())
		self.assertEqual(resp['meta']['pagination']['count'], col.count())
Example #4
0
	def testListBugsInProject(self):
		colName = 'bugs'
		retClass = Bug
		resp = self._rcol(colName, ['_id', 'title', '_status_id', '_severity_id', '_project_version_id',
			'_project_section_id', '_type_id', '_reproducibility_id', '_priority_id', '_assigned_user_id', 'description',
			'expected_results'])
		self._client.debugReturn = {'data': json.dumps(resp), 'status': 200}

		col = Project(self._client, {'id': 0}).bugs.all()

		self.assertEqual(resp[colName], col.toArray())
		self.assertIsInstance(col._collection[0], retClass)
		self.assertEqual(resp['meta']['pagination']['total'], col.total())
		self.assertEqual(resp['meta']['pagination']['total_pages'], col.totalPages())
		self.assertEqual(resp['meta']['pagination']['count'], col.count())