Skip to content

Commit

Permalink
feat: add tests WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
juancarlospaco committed Jan 23, 2025
1 parent 9ba15e1 commit 7a397e0
Showing 1 changed file with 41 additions and 41 deletions.
82 changes: 41 additions & 41 deletions tests/_sync/test_gotrue_admin_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,6 @@ def test_create_user_should_create_a_new_user():
assert response.email == credentials.get("email")


# def test_create_user_with_user_metadata():
# user_metadata = mock_user_metadata()
# credentials = mock_user_credentials()
# response = service_role_api_client().create_user(
# {
# "email": credentials.get("email"),
# "password": credentials.get("password"),
# "user_metadata": user_metadata,
# }
# )
# assert response.user.email == credentials.get("email")
# assert response.user.user_metadata == user_metadata
# assert "profile_image" in response.user.user_metadata


def test_create_user_with_app_metadata():
app_metadata = mock_app_metadata()
credentials = mock_user_credentials()
Expand Down Expand Up @@ -257,32 +242,6 @@ def test_resend_missing_credentials():
assert e.to_dict()


# def test_weak_email_password_error():
# credentials = mock_user_credentials()
# try:
# client_api_auto_confirm_off_signups_enabled_client().sign_up(
# {
# "email": credentials.get("email"),
# "password": "123",
# }
# )
# except AuthWeakPasswordError as e:
# assert e.to_dict()


# def test_weak_phone_password_error():
# credentials = mock_user_credentials()
# try:
# client_api_auto_confirm_off_signups_enabled_client().sign_up(
# {
# "phone": credentials.get("phone"),
# "password": "123",
# }
# )
# except AuthWeakPasswordError as e:
# assert e.to_dict()


def test_sign_in_anonymously():
try:
response = auth_client_with_session().sign_in_anonymously()
Expand Down Expand Up @@ -580,3 +539,44 @@ def test_update_user():
"password": "123e5a",
}
)


# def test_create_user_with_user_metadata():
# user_metadata = mock_user_metadata()
# credentials = mock_user_credentials()
# response = service_role_api_client().create_user(
# {
# "email": credentials.get("email"),
# "password": credentials.get("password"),
# "user_metadata": user_metadata,
# }
# )
# assert response.user.email == credentials.get("email")
# assert response.user.user_metadata == user_metadata
# assert "profile_image" in response.user.user_metadata


# def test_weak_email_password_error():
# credentials = mock_user_credentials()
# try:
# client_api_auto_confirm_off_signups_enabled_client().sign_up(
# {
# "email": credentials.get("email"),
# "password": "123",
# }
# )
# except AuthWeakPasswordError as e:
# assert e.to_dict()


# def test_weak_phone_password_error():
# credentials = mock_user_credentials()
# try:
# client_api_auto_confirm_off_signups_enabled_client().sign_up(
# {
# "phone": credentials.get("phone"),
# "password": "123",
# }
# )
# except AuthWeakPasswordError as e:
# assert e.to_dict()

0 comments on commit 7a397e0

Please sign in to comment.