Repository: getmoto/moto

Issue:
cognito-idp admin_get_user should raise a UserNotFoundException, when user not in pool
Hi,

when using cognito-idp and searching for a non existing user, the Exception raised is `ResourceNotFoundException`, the Exception i'm expecting to be raised is a `UserNotFoundException`

This is how to reproduce in moto 
```python
import moto
import boto3
with moto.mock_cognitoidp():
    cognito = boto3.client('cognito-idp')
    create_pool_kwargs = {
        "PoolName": "test_pool",
        "Schema": [
            {
                "Name": "email",
                "AttributeDataType": "String",
                "Required": True,
                "Mutable": True,
            }
        ],
        "AdminCreateUserConfig": {
            "AllowAdminCreateUserOnly": True, "UnusedAccountValidityDays": 1
        },
    }
    pool = cognito.create_user_pool(**create_pool_kwargs)['UserPool']
    cognito.admin_get_user(Username='missing', UserPoolId=pool['Id'])
```

This is the Traceback generated 
```
Traceback (most recent call last):
  File "<stdin>", line 18, in <module>
  File "/Library/Python/2.7/site-packages/botocore/client.py", line 314, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/Library/Python/2.7/site-packages/botocore/client.py", line 612, in _make_api_call
    raise error_class(parsed_response, operation_name)
botocore.errorfactory.ResourceNotFoundException: An error occurred (ResourceNotFoundException) when calling the AdminGetUser operation: missing
```

Here's the same command run against a user pool in aws, where boto raises a `UserNotFoundException`

```python
import boto3
cognito = boto3.client('cognito-idp')
cognito.admin_get_user(Username='missing', UserPoolId='eu-west-1_zsFiodetm')
```
And the Traceback from that call
```
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Python/2.7/site-packages/botocore/client.py", line 314, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/Library/Python/2.7/site-packages/botocore/client.py", line 612, in _make_api_call
    raise error_class(parsed_response, operation_name)
botocore.errorfactory.UserNotFoundException: An error occurred (UserNotFoundException) when calling the AdminGetUser operation: User does not exist.
```

This is also the same for admin_delete_user

```
>>> cognito.admin_delete_user(Username='missing', UserPoolId='eu-west-1_zsFiodetm')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Python/2.7/site-packages/botocore/client.py", line 314, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/Library/Python/2.7/site-packages/botocore/client.py", line 612, in _make_api_call
    raise error_class(parsed_response, operation_name)
botocore.errorfactory.UserNotFoundException: An error occurred (UserNotFoundException) when calling the AdminDeleteUser operation: User does not exist.
```

I'm using the package installed via pip and python mocks. 
```
moto==1.3.4
botocore==1.10.52
boto3==1.7.3
```



Discussion:
Thanks; setting as a feature request.

Resolving patch:
diff --git a/moto/cognitoidp/models.py b/moto/cognitoidp/models.py
--- a/moto/cognitoidp/models.py
+++ b/moto/cognitoidp/models.py
@@ -383,7 +383,7 @@ def admin_get_user(self, user_pool_id, username):
             raise ResourceNotFoundError(user_pool_id)
 
         if username not in user_pool.users:
-            raise ResourceNotFoundError(username)
+            raise UserNotFoundError(username)
 
         return user_pool.users[username]
 
@@ -408,7 +408,7 @@ def admin_delete_user(self, user_pool_id, username):
             raise ResourceNotFoundError(user_pool_id)
 
         if username not in user_pool.users:
-            raise ResourceNotFoundError(username)
+            raise UserNotFoundError(username)
 
         del user_pool.users[username]
 


Test patch:
diff --git a/tests/test_cognitoidp/test_cognitoidp.py b/tests/test_cognitoidp/test_cognitoidp.py
--- a/tests/test_cognitoidp/test_cognitoidp.py
+++ b/tests/test_cognitoidp/test_cognitoidp.py
@@ -368,6 +368,22 @@ def test_admin_get_user():
     result["UserAttributes"][0]["Value"].should.equal(value)
 
 
+@mock_cognitoidp
+def test_admin_get_missing_user():
+    conn = boto3.client("cognito-idp", "us-west-2")
+
+    username = str(uuid.uuid4())
+    user_pool_id = conn.create_user_pool(PoolName=str(uuid.uuid4()))["UserPool"]["Id"]
+
+    caught = False
+    try:
+        conn.admin_get_user(UserPoolId=user_pool_id, Username=username)
+    except conn.exceptions.UserNotFoundException:
+        caught = True
+
+    caught.should.be.true
+
+
 @mock_cognitoidp
 def test_list_users():
     conn = boto3.client("cognito-idp", "us-west-2")
@@ -423,7 +439,7 @@ def test_admin_delete_user():
     caught = False
     try:
         conn.admin_get_user(UserPoolId=user_pool_id, Username=username)
-    except conn.exceptions.ResourceNotFoundException:
+    except conn.exceptions.UserNotFoundException:
         caught = True
 
     caught.should.be.true