def test_load_file_or_str_with_Path(fcontent): p = Path(__file__).parent / 'resources' / 'test-file.txt' assert utils.load_file_or_str(str(p)) == fcontent assert utils.load_file_or_str(p) == fcontent assert utils.load_file_or_str(fcontent) == fcontent with pytest.raises(exceptions.ProvidedPathNotFound): utils.load_file_or_str(Path(__file__) / 'foobar')
def test_load_file_or_str_with_str(fcontent): p = path.join(path.dirname(path.abspath(__file__)), 'resources', 'test-file.txt') assert utils.load_file_or_str(p) == fcontent