Skip to content

Commit

Permalink
modified existing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yash-ni committed Aug 30, 2023
1 parent 1b4c73d commit df92ba0
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def read_json(filepath):
test_data = json.load(file)
return test_data

GetFeature_json_file_path = f'{os.path.dirname(os.path.abspath(__file__))}/testcases/GetFeature.json'
GetFeature_json_file_path = f'{os.path.dirname(os.path.dirname(os.path.abspath(__file__)))}/testcases/GetFeature.json'

@pytest.mark.parametrize('testcase', read_json(GetFeature_json_file_path))
def test_SayHello(testcase):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def read_json(filepath):
test_data = json.load(file)
return test_data

GetFeature_json_file_path = f'{os.path.dirname(os.path.abspath(__file__))}/testcases/GetFeature.json'
GetFeature_json_file_path = f'{os.path.dirname(os.path.dirname(os.path.abspath(__file__)))}/testcases/GetFeature.json'

@pytest.mark.parametrize('testcase', read_json(GetFeature_json_file_path))
def test_SayHello(testcase):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def read_json(filepath):
test_data = json.load(file)
return test_data

SayHello_json_file_path = f'{os.path.dirname(os.path.abspath(__file__))}/testcases/SayHello.json'
SayHello_json_file_path = f'{os.path.dirname(os.path.dirname(os.path.abspath(__file__)))}/testcases/SayHello.json'

def get_SayHello_output(test_input):
name = test_input['name']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def read_json(filepath):
test_data = json.load(file)
return test_data

GetFeature_json_file_path = f'{os.path.dirname(os.path.abspath(__file__))}/testcases/GetFeature.json'
GetFeature_json_file_path = f'{os.path.dirname(os.path.dirname(os.path.abspath(__file__)))}/testcases/GetFeature.json'

@pytest.mark.parametrize('testcase', read_json(GetFeature_json_file_path))
def test_SayHello(testcase):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def read_json(filepath):
test_data = json.load(file)
return test_data

GetFeature_json_file_path = f'{os.path.dirname(os.path.abspath(__file__))}/testcases/GetFeature.json'
GetFeature_json_file_path = f'{os.path.dirname(os.path.dirname(os.path.abspath(__file__)))}/testcases/GetFeature.json'

@pytest.mark.parametrize('testcase', read_json(GetFeature_json_file_path))
def test_SayHello(testcase):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def read_json(filepath):
test_data = json.load(file)
return test_data

GetFeature_json_file_path = f'{os.path.dirname(os.path.abspath(__file__))}/testcases/GetFeature.json'
GetFeature_json_file_path = f'{os.path.dirname(os.path.dirname(os.path.abspath(__file__)))}/testcases/GetFeature.json'

@pytest.mark.parametrize('testcase', read_json(GetFeature_json_file_path))
def test_SayHello(testcase):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def read_json(filepath):
test_data = json.load(file)
return test_data

GetFeature_json_file_path = f'{os.path.dirname(os.path.abspath(__file__))}/testcases/GetFeature.json'
GetFeature_json_file_path = f'{os.path.dirname(os.path.dirname(os.path.abspath(__file__)))}/testcases/GetFeature.json'

@pytest.mark.parametrize('testcase', read_json(GetFeature_json_file_path))
def test_GetFeature(testcase):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def read_json(filepath):
test_data = json.load(file)
return test_data

GetFeature_json_file_path = f'{os.path.dirname(os.path.abspath(__file__))}/testcases/GetFeature.json'
GetFeature_json_file_path = f'{os.path.dirname(os.path.dirname(os.path.abspath(__file__)))}/testcases/GetFeature.json'

@pytest.mark.parametrize('testcase', read_json(GetFeature_json_file_path))
def test_SayHello(testcase):
Expand Down
4 changes: 3 additions & 1 deletion tests/New_ATS/pylib/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ def count_failed_testcases(test_summary):
def run_command(command):
output = subprocess.run(command, capture_output=True, text=True)
if output.stderr:
raise Exception(output.stderr)
# raise Exception(output.stderr)
print(output.stderr)
return output.stdout


Expand Down Expand Up @@ -131,6 +132,7 @@ def run_test(test_config):
rpc_name
])
print (f"Running python client for {rpc_name}")
print(run_client_command)
output = run_command(run_client_command)
print(output+'\n')
FAILED += count_failed_testcases(output)
Expand Down
11 changes: 10 additions & 1 deletion tests/New_ATS/pylib/testlist.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
[
{
"name": ["routeguide"],
"name": [
"helloworld",
"routeguide",
"enum-oneof",
"message-oneof",
"multiple-field-oneof",
"nested-oneof",
"sibling-oneof",
"simple-oneof"
],
"gen_type": "0",
"labview_version": "2019",
"labview_bitness": "32"
Expand Down

0 comments on commit df92ba0

Please sign in to comment.