title: Unit Testing: Assert that a file/path exists
body: <p>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.</p>
  
  <p>Is there a way to assert that a file/folder exists? I am getting a AssertionError error for the following code:</p>
  
  <pre><code>assert os.path.exists(LOCAL_INSTALL_DIR) == 1
  </code></pre>
  
  <p>Why am I getting this error and how can I fix it? My function:</p>
  
  <pre><code>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 ) )
  </code></pre>