def test_set_y_step(): # Create a Shape object from the header shape = Shape({ 'x_number': 143, 'x_start': 84000, 'x_step': 500, 'x_stop': 155000, 'y_number': 143, 'y_start': 455000, 'y_step': 500, 'y_stop': 526000 }) # Set the y_step to 250 shape.set_y_step(250) # Extract the dict from the Shape object shape_dict = shape.to_dict() # Compare with the desired input assert shape_dict == { 'x_number': 143, 'x_start': 84000, 'x_step': 500, 'x_stop': 155000, 'y_number': 285, 'y_start': 455000, 'y_step': 250, 'y_stop': 526000 }
def test_set_y_step_inf(): # Create a Shape object from the header shape = Shape({ 'x_number': 143, 'x_start': 84000, 'x_step': 500, 'x_stop': 155000, 'y_number': 143, 'y_start': 455000, 'y_step': 500, 'y_stop': 526000 }) # Set the x_step to nan step = np.inf shape.set_y_step(step) assert False