import json
from tests.helpers import FlaskTestCase, fixtures


class TestUserAPI(FlaskTestCase):

    @fixtures('base.json')
    def test_get_empty_users(self):
        """Test GET /api/users endpoint with no data"""
        response, data = self.api_request('get', '/api/users')
        assert data['num_results'] is 0
        assert response.status_code is 200

    @fixtures('single_user.json')
    def test_get_one_user(self):
        """Test GET /api/users endpoint with a single user"""
        response, data = self.api_request('get', '/api/users')
        assert data['num_results'] is 1
        assert response.status_code is 200

    @fixtures('many_users.json')
    def test_get_multiple_users(self):
        """Test GET /api/users endpoint with multple users"""

    @fixtures('many_users.json')
    def test_get_no_user_by_id(self):
        """Test GET /api/users/(int:id) for missing user"""

    @fixtures('many_users.json')
    def test_user_by_id(self):
        """Test GET /api/users(int:id) for existing user"""

    @fixtures('base.json')
    def test_post_user(self):
        data = {
            'name': 'Giancarlo Anemone',
            'username': 'ganemone',
            'email': 'ganemone@gmail.com',
            'password': 'password',
            'confirm': 'password'
        }
        response = self.app.post(
            '/api/users',
            data=json.dumps(data)
        )

        assert response.status_code is 201

@@ -767,16 +767,161 @@
 users%22%22%22
+%0A        response, data = self.api_request('get', '/api/users')%0A        assert data%5B'num_results'%5D %3E 0%0A        assert response.status_code is 200
 %0A%0A    @f
@@ -1036,32 +1036,143 @@
  missing user%22%22%22
+%0A        response, data = self.api_request('get', '/api/users/1000')%0A        assert response.status_code == 404
 %0A%0A    @fixtures(
@@ -1280,16 +1280,170 @@
  user%22%22%22
+%0A        response, data = self.api_request('get', '/api/users/1')%0A        assert data%5B'username'%5D == 'ganemone'%0A        assert response.status_code is 200
 %0A%0A    @f

Implement all user unit tests for GET requests