I am very new to unit testing and I need to write a unit test for spark read/write function.
I have a function as below for example:
def read_file(path, format, logger):
df = spark.read.load(path, format = format)
etc.....
return df
note : the path is mounted.
now I need to write unit test for this function / mock adls location.
I have checked below link which is using patch to mock blobServiceClient but I am not sure whether this is useful to me as it is using open function of python.
Trying to use patch to mock BlobServiceClient but the real class is called instead
Is it even possible to mock adls and if so how?
Can anyone please help me in this. Any help would be appreciated.