Exemplo n.º 1
0
def test_dis():
    x = 20
    y = 15
    assert dis(x, y) == 25.0
Exemplo n.º 2
0
"""

Name     : distance.py
Date     : 26/08/2019
Purpose  :  Prints the distance between the two points

"""

from Utility import utility

while True:
    try:
        #Getting the values of x and y from the user
        x = int(input("Enter the value for x : "))
        y = int(input("Enter the value for y : "))
        # calling the dis() function in the utility class
        distance = utility.dis(x, y)
        print("The Eucledian distance is : ", distance)
        break
    except ValueError:
        print("Please enter numbers only")


Exemplo n.º 3
0
def test_disinteger():
    with pytest.raises(TypeError):
        result = dis(json_string['distance'][3]['input1'],
                     json_string['distance'][3]['input2'])
        assert result == json_string['distance'][3]['output']