Skip to content

Commit 238ce59

Browse files
committed
Try to fix the test
Signed-off-by: Chin Yeung Li <[email protected]>
1 parent 9035cf2 commit 238ce59

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tests/test_model.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1278,7 +1278,6 @@ def test_valid_api_url(self, mock_data):
12781278
@mock.patch('attributecode.model.valid_api_url')
12791279
def test_pre_process_and_fetch_license_dict_dje(self, have_network_connection, valid_api_url):
12801280
have_network_connection.return_value = True
1281-
12821281
valid_api_url.return_value = False
12831282
error_msg = (
12841283
'Network problem. Please check your Internet connection. '
@@ -1291,14 +1290,18 @@ def test_pre_process_and_fetch_license_dict_dje(self, have_network_connection, v
12911290
assert model.pre_process_and_fetch_license_dict([]) == expected
12921291

12931292
@mock.patch('attributecode.util.have_network_connection')
1294-
def test_pre_process_and_fetch_license_dict_licensedb(self, have_network_connection):
1293+
@mock.patch('attributecode.model.valid_api_url')
1294+
def test_pre_process_and_fetch_license_dict_licensedb(self, have_network_connection, valid_api_url):
12951295
have_network_connection.return_value = False
1296+
valid_api_url.return_value = False
12961297
error_msg = (
12971298
'Network problem. Please check your Internet connection. '
12981299
'License generation is skipped.')
12991300
expected = ({}, [Error(ERROR, error_msg)])
13001301
assert model.pre_process_and_fetch_license_dict([]) == expected
13011302

13021303
have_network_connection.return_value = True
1304+
valid_api_url.return_value = True
13031305
expected = ({}, [])
1306+
13041307
assert model.pre_process_and_fetch_license_dict([]) == expected

0 commit comments

Comments
 (0)