Added test case and update formatting PEP 8