import requests
URL = 'http://localhost:5000/calc'
def test_add():
    data = {
        'operation': '+',
        'x': 60,
        'y': 40
    }
    response = requests.post(URL, data = data)
    assert (response.status_code, int(response.text)) == (201, 100)

def test_minus():
    data = {
        'operation': '-',
        'x': 60,
        'y': 40
    }
    response = requests.post(URL, data = data)
    assert (response.status_code, int(response.text)) == (201, 20)

def test_mult():
    data = {
        'operation': '*',
        'x': 60,
        'y': 40
    }
    response = requests.post(URL, data = data)
    assert (response.status_code, int(response.text)) == (201, 2400)

def test_div_1():
    data = {
        'operation': '/',
        'x': 60,
        'y': 40
    }
    response = requests.post(URL, data = data)
    assert (response.status_code, float(response.text)) == (201, 1.5)

def test_div_2():
    data = {
        'operation': '//',
        'x': 60,
        'y': 40
    }
    response = requests.post(URL, data = data)
    assert (response.status_code, int(response.text)) == (201, 1)
if __name__ == "__main__":
    data = {
        'operation': '//',
        'x': 60,
        'y': 40
    }
    response = requests.post(URL, data = data)
    print(response.status_code, int(response.text))
import requests
URL = 'http://localhost:5000/calc'
def test_add():
    data = {
        'operation': '+',
        'x': 60,
        'y': 40
    }
    response = requests.post(URL, data = data)
    assert (response.status_code, int(response.text)) == (201, 100)

def test_minus():
    data = {
        'operation': '-',
        'x': 60,
        'y': 40
    }
    response = requests.post(URL, data = data)
    assert (response.status_code, int(response.text)) == (201, 20)

def test_mult():
    data = {
        'operation': '*',
        'x': 60,
        'y': 40
    }
    response = requests.post(URL, data = data)
    assert (response.status_code, int(response.text)) == (201, 2400)

def test_div_1():
    data = {
        'operation': '/',
        'x': 60,
        'y': 40
    }
    response = requests.post(URL, data = data)
    assert (response.status_code, float(response.text)) == (201, 1.5)

def test_div_2():
    data = {
        'operation': '//',
        'x': 60,
        'y': 40
    }
    response = requests.post(URL, data = data)
    assert (response.status_code, int(response.text)) == (201, 1)
if __name__ == "__main__":
    data = {
        'operation': '//',
        'x': 60,
        'y': 40
    }
    response = requests.post(URL, data = data)
    print(response.status_code, int(response.text))