I am attempting to create a regression test for my Installer. The regression test is a script written in Python. The test checks that the correct files have been installed in the correct place.
Is there a way to assert that a file/folder exists? I am getting a AssertionError error for the following code:
assert os.path.exists(LOCAL_INSTALL_DIR) == 1
Why am I getting this error and how can I fix it? My function:
def check_installation_files_exist():
assert os.path.exists(LOCAL_INSTALL_DIR) == 1
assert os.path.exists(INSTALL_DIR) == 1
correct_install_files = normalise_file_names( os.listdir( LOCAL_INSTALL_DIR ) )
installed_files = normalise_file_names( os.listdir( INSTALL_DIR ) )
The path described by LOCAL_INSTALL_DIR
either does not exist, is a broken symbolic link, or you do not have permission to stat()
it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With