Test subprocess call to list directory contents
Preconditions (3)
Step 1: Write a Python function that uses subprocess.run to execute 'ls' (Linux/macOS) or 'dir' (Windows) command
Step 2: Capture the output of the subprocess call
Step 3: Write a pytest test function to call this function
Step 4: Assert that the subprocess call returns exit code 0
Step 5: Assert that the output contains at least one known file or directory name (e.g., the current script file or folder)
✅ Expected Result: The test passes if the subprocess call succeeds with exit code 0 and the output contains the expected file or directory name.