Add test cases for __uploadPathIsAvailable()
Fix scoping issue