This week lab was helpful for me to practice
writing a unittest. I have learnt and
also have seen what unittest is and what it does in csc108 course, but I didn’t
have any experience writing it. During the lab, I and my partner had to write
one, but both of us didn’t know what to write. So we looked up how to write and
the examples we went over during a lecture. I was not sure the way I wrote is right
or not but since it worked without raising an error, I thought it was ok. I need
more practice on this. New stuffs I learnt were an importance of tearDown
method in unittest and a proper way to write a super method. The first method
clears up all the data at the end to return to its initial state. Another
method is super (SubClass, instance).method (args). This one is similar as using
Class.method(args). I was not sure about the super method, but since I know it I
should get used to using it. As well as, I should practice more on writing a
unittest, too!
댓글 없음:
댓글 쓰기