Of course you can test it! In fact, you should test any section before moving on whenever possible. It's just good coding practice! You may even want to build in some extra code temporarily, just to test it. It's always best to make sure that a function is fully tested and working correctly before moving on to another, whenever possible. (Dependencies on other functions could hinder this until they too are written, tested and working, or at least have a code stub in place.)
As for the permission denied problem, it's difficult to say what is wrong without more info. If the error tells you what file is denied, go to that directory and check the permissions with the
ls filename command. You can change the permissions on that file with the
chmod command. If not, let us know what happened.
if you are satisfied with this answer, please mark this item as answered. Let's keep up on the forum housekeeping. ;-)