Added 2 unit tests. Refs #8994.

2 unit tests are added and passed;
1 unit test is added but not completed.
Some bugs are fixed in algorithm python code.