Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_investpy_bonds():
"""
This function checks that bond data retrieval functions listed in investpy work properly.
"""
params = [
{
'country': 'spain',
},
{
'country': None,
},
]
for param in params:
investpy.get_bonds(country=param['country'])
investpy.get_bonds_list(country=param['country'])
params = [
{
'country': None,
'columns': ['full_name', 'name'],
'as_json': True
},
{
'country': None,
'columns': ['full_name', 'name'],
'as_json': False
},
{
'country': 'spain',
'columns': ['full_name', 'name'],
"""
This function raises errors on bond retrieval functions.
"""
params = [
{
'country': ['error']
},
{
'country': 'error'
},
]
for param in params:
try:
investpy.get_bonds(country=param['country'])
except:
pass
try:
investpy.get_bonds_list(country=param['country'])
except:
pass
params = [
{
'country': ['error'],
'columns': None,
'as_json': False
},
{
'country': 'spain',