def mock_isfile(fn, *args, **kwargs):
    'Mock os.path.isfile()'
    if (fn.endswith('cert') or fn.endswith('chain') or fn.endswith('privkey')):
        return True
    return orig_open(fn)
Mock os.path.isfile()
def mock_isfile(fn, *args, **kwargs):
    
    if (fn.endswith('cert') or fn.endswith('chain') or fn.endswith('privkey')):
        return True
    return orig_open(fn)