I have the following code in a python file. I have to unit test this file. But in order to do that I need to instantiate the object of the class
class BigQuery(metaclass=singleton.Singleton):
"""
Big Query Class for operations on big query
Will standardize in future versions.
"""
def __init__(self):
"""
Used for initializing client
"""
try:
self.client = bigquery.Client.from_service_account_json(
SERVICE_ACCOUNT_JSON)
except:
logging.error("Cannot instantiate bigquery client", exc_info=True)
raise Exception("Cannot instantiate bigquery client.")
The above class also contains other methods that needs to be tested. How will I mock the object for every method without calling bigquery API??