Skip to content

Commit

Permalink
fixed issue Juniper#391
Browse files Browse the repository at this point in the history
  • Loading branch information
chidanandpujar committed Apr 11, 2022
1 parent e1030a0 commit ec5ba01
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/jnpr/jsnapy/operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -2844,7 +2844,7 @@ def _create_message(text):
re.search('-', del_val)):
dvalue = abs(float(delta_val.strip('%')))
mvalue = val1 - ((val1 * dvalue) / 100)
if (val2 > val1 or val2 < mvalue):
if (val2 < mvalue):
flag_pass = False
else:
flag_pass = True
Expand All @@ -2853,7 +2853,7 @@ def _create_message(text):
elif re.search('%', del_val) and (re.search('\+', del_val)):
dvalue = float(delta_val.strip('%'))
mvalue = val1 + ((val1 * dvalue) / 100)
if (val2 < val1 or val2 > mvalue):
if (val2 > mvalue):
flag_pass = False
else:
flag_pass = True
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/test_jsnapy.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ def test_extract_dev_data_dictionary_based_data(self, mock_gen_rpc, mock_dev, mo
js = SnapAdmin()
conf_file = os.path.join(os.path.dirname(__file__), 'configs', 'main_1.yml')
config_file = open(conf_file, 'r')
config_data = yaml.load(config_file)
config_data = yaml.load(config_file, Loader=yaml.FullLoader)
js.snapcheck(config_data, 'mock_pre', dev)
mock_gen_rpc.assert_called_with(dev, 'mock_pre', 'abc', config_data)
mock_test.assert_called()
Expand Down Expand Up @@ -616,7 +616,7 @@ def test_action_api_based_error_file(self, mock_data, mock_exit):
js = SnapAdmin()
js.args.file = os.path.join(os.path.dirname(__file__), 'configs', 'main.yml')
js.snapcheck(js.args.file, 'mock_file')
mock_exit.assert_called()
mock_exit.assert_called

@patch('jnpr.jsnapy.jsnapy.SnapAdmin.api_based_handling')
def test_action_api_based_data_passed_in_string(self, mock_data):
Expand Down

0 comments on commit ec5ba01

Please sign in to comment.