Skip to content

Commit bc65db9

Browse files
committed
Update code as per commit
1 parent 6a26b96 commit bc65db9

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/arguments/api_test.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,9 @@ def fetch_input_url(cls):
5050
def read_data_from_file(cls):
5151
filename = input("Enter a filename (response_data.json)")
5252
data = {}
53-
if len(filename.trim()) == 0:
54-
print("filename empty, so default file (response_data.json) is used ")
53+
if filename == "":
54+
filename = "response_data.json"
55+
print(f"filename empty, so default file {filename} is used ")
5556
with open(filename, "r") as reader:
5657
file_content = reader.read()
5758
try:
@@ -65,9 +66,10 @@ def read_data_from_file(cls):
6566

6667
@classmethod
6768
def enter_data_payload(cls):
68-
store = int(input("Please choose the below options? (1/2/3)"))
6969
print("Option 1: For sending data payload from terminal\n")
7070
print("Option 2: For sending data payload by reading from json file\n")
71+
store = int(input("Please choose the above options? (1/2)"))
72+
7173
data = {}
7274
if store == 1:
7375
data = input("Enter data as key value pairs")

0 commit comments

Comments
 (0)