Skip to content

Commit 159b886

Browse files
author
Alvaro Arroyo Parejo
committed
adding SSL_VERIFICATION variable and adding assert to test get object url
1 parent 7b9fea5 commit 159b886

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

test/test_neocc_remote.py

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
API_URL = conf.API_URL
3030
DATA_DIR = os.path.join(os.path.dirname(__file__), 'data')
3131
TIMEOUT = conf.TIMEOUT
32-
VERIFICATION = conf.VERIFICATION
32+
VERIFICATION = conf.SSL_CERT_VERIFICATION
3333

3434
class TestLists:
3535
"""Class which contains the unitary tests for lists module.
@@ -439,22 +439,14 @@ def test_get_object_url(self):
439439
"""Test for checking the URL termination for requested object tab.
440440
Check invalid list name raise KeyError.
441441
"""
442-
# Valid object names
443-
object_names = ['433', '433 Eros', '99942 Apophis', '1998MR24',
444-
'594936 2021EX2']
445442
# Dictionary for tabs
446443
tab_dict = {
447444
"impacts": '.risk',
448445
"close_approaches": '.clolin',
449446
"observations": '.rwo',
447+
"physical_properties": '.phypro',
450448
"orbit_properties": ['.ke0', '.ke1', '.eq0', '.eq1']
451449
}
452-
# Valid inputs
453-
valid_tabs = ["impacts", "close_approaches", "observations",
454-
"orbit_properties"]
455-
# Invalid inputs
456-
bad_tabs = ["ASedfe", "%&$", "ÁftR+"]
457-
458450
# Choose a random object from stored nea list
459451
rnd_object = random.choice(self.nea_list)
460452
# Tabs to test
@@ -478,7 +470,9 @@ def test_get_object_url(self):
478470
with pytest.raises(KeyError):
479471
tabs.get_object_url(rnd_object, tab)
480472
else:
481-
url = 1
473+
assert tabs.get_object_url(rnd_object, tab) ==\
474+
str(rnd_object).replace(' ', '%20') +\
475+
tab_dict[tab]
482476

483477

484478
def test_get_object_data(self):

0 commit comments

Comments
 (0)