• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

The ISample Interface

Reusing the examples from Chapters 40 and 41, “Doc Tests: Example-Driven Unit Tests”, you can now develop an ISample interface that provides a title attribute and uses the methods getDescription() and setDescription() for dealing with the description of the object.

Again, you want to keep the code contained in one file for simplicity, so you need to open a file called test_isample.py anywhere and add the following interface to it:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint