refactored request test into pytest