Refactor postgresql args function
Add commands_tests.py