added examples csv

This commit is contained in:
Sergey
2024-08-06 20:15:56 +03:00
parent 50155cd4d6
commit fb01ebd1e5
6 changed files with 27 additions and 5 deletions

View File

@@ -3,7 +3,6 @@
# __author__ = 'szhdanoff@gmail.com'
import os
import json
import httpx
# local imports
import app
import requests
@@ -72,7 +71,7 @@ def get_user(search_id, get_type='auto', headers=None):
return False, r.json()
def new_user(headers=None):
def new_user(nickname, phone, foreign_card=None, headers=None):
"""
A function that creates a new user with optional headers.
@@ -83,13 +82,20 @@ def new_user(headers=None):
tuple: A tuple containing a boolean indicating the success of the request and the JSON response.
If the request is successful, the boolean is True and the JSON response is returned.
If the request is unsuccessful, the boolean is False and the JSON response is returned.
:param foreign_card:
:param headers:
:param phone:
:param nickname :
"""
if headers is None:
headers = HEADERS
base_url = url + '/users/'
params = {}
params = {
"name": nickname ,
"phone": phone,
}
r = requests.post(base_url, headers=headers, json=params)
if r.status_code == 201: