Thursday, November 4, 2010

SBR600 Project "fedpkg Test Suite" -- release 0.1

I decide to do the release 0.1 of my project although there are not as many functions being tested as I planned to. I believe that the stage one of fedpkg Test Suite is mainly to learn Python. I spent, cumulatively, about 3 - 4 weeks to get myself familiar with the syntax of Python.

The stage one of my project is to write some simple functions and use nose to run the test. As exercise of programming Python, I wrote three functions on list. List is relatively simpler than dictionary. Maybe I will add one or two functions of dictionary to run the nose test on them. But the nose principle is the same. Just coding on dictionary should be more complex (so, it's about the skill of Python).

I wrote three functions on list. They are all very simple. One is to remove negative items from a number list. I blogged some details in my last post. Another function is to find duplicate items in a list and return a set of these duplicates. The third function is bubble sort.

The test functions are in the same file as the functions being tested. Because they all very small, it's easier to debugging this way. The name of the test function has to start with test. I mainly use keyword assert to test the results.

From here, I need to dive in the fedpkg code. I also need to get familiar with the functionality of fedpkg, which probably need certain knowledge of Git. Another thing I am still not clear is the relationship between nose and unittest framework. I thought they are the same at beginning, but probably they are not.

I dump the test code in my matrix account:
http://matrix.senecac.on.ca/~zwang98/nosetest.html

No comments:

Post a Comment