Added Whitespace and Docstring (#924)

* Added Whitespace and Docstring

I modified the file to make Pylint happier and make the code more readable.

* Beautified Code and Added Docstring

I modified the file to make Pylint happier and make the code more readable.

* Added DOCSTRINGS, Wikipedia link, and whitespace

I added DOCSTRINGS and whitespace to make the code more readable and understandable.

* Improved Formatting

* Wrapped comments
* Fixed spelling error for `movement` variable
* Added DOCSTRINGs

* Improved Formatting

* Corrected whitespace to improve readability.
* Added docstrings.
* Made comments fit inside an 80 column layout.
This commit is contained in:
PatOnTheBack
2019-07-01 04:10:18 -04:00
committed by John Law
parent 2333f93323
commit bd4017928e
12 changed files with 154 additions and 87 deletions

View File

@ -1,3 +1,5 @@
"""Test Sort Algorithms for Errors."""
from bogo_sort import bogo_sort
from bubble_sort import bubble_sort
from bucket_sort import bucket_sort
@ -36,8 +38,8 @@ TEST_CASES = [
TODO:
- Fix some broken tests in particular cases (as [] for example),
- Unify the input format: should always be function(input_collection) (no additional args)
- Unify the output format: should always be a collection instead of updating input elements
and returning None
- Unify the output format: should always be a collection instead of
updating input elements and returning None
- Rewrite some algorithms in function format (in case there is no function definition)
'''
@ -71,4 +73,4 @@ TEST_FUNCTIONS = [
for function in TEST_FUNCTIONS:
for case in TEST_CASES:
result = function(case['input'])
assert result == case['expected'], 'Executed function: {}, {} != {}'.format(function.__name__, result, case['expected'])
assert result == case['expected'], 'Executed function: {}, {} != {}'.format(function.__name__, result, case['expected'])