Skip to content

Latest commit

 

History

History
120 lines (81 loc) · 1.63 KB

README.MD

File metadata and controls

120 lines (81 loc) · 1.63 KB

Test of Chotot.vn

TODO

  • Refactor, reduce line of code, optimze processing
  • Separate development mode, test mode and production mode for database
  • Implements Factory to generate test data
  • Optimize queries

Change database connect at model/base.py. We should refactor it to config file soon

Install requirements

pip install -r requirements.txt

Run tests

python test.py

Result:

Previews

List of GETs API:

List of users

GET /api/v1/users

Return from server

{
	"status": "SUCESS",
	"data": [
		{
			"email": "[email protected]",
			"id": 1
		},
		{
			"email": "[email protected]",
			"id": 2
		}
	]
}

User Detail

GET /api/v1/users/:id

Return from server

{
	"data": {
		"email": "[email protected]",
		"id": 1
	},
	"status": "SUCCESS"
}

List of projects

GET /api/v1/projects

Return from server

{
	"status": "SUCESS",
	"data": [
		{
			"content": "Just a test for project data", 
			"due_date": "Thu, 12 Mar 2015 12:00:00 GMT", 
			"id": 1, 
			"title": "Test Project"
		},
		{
			"content": "Just a test for project data", 
			"due_date": "Thu, 12 Mar 2015 12:00:00 GMT", 
			"id": 1, 
			"title": "Test Project"
		}
	]
}

User Detail

GET /api/v1/projects/:id

Return from server

{
	"data": {
		"content": "Just a test for project data", 
		"due_date": "Thu, 12 Mar 2015 12:00:00 GMT", 
		"id": 1, 
		"title": "Test Project"
	},
	"status": "SUCCESS"
}

Same as other apis:

List of teams

GET /api/v1/teams

Detail of team

GET /api/v1/teams/:id

List of tasks

GET /api/v1/tasks

Detail of tasks

GET /api/v1/tasks/:id