Attachment 'mock_objects.py'

Download

   1 #----------------------------------------------------------------------------
   2 # Name:         mock_objects.py
   3 # Purpose:      Mock objects to be used by the tests, as you can see... no wx
   4 #
   5 # Author:       Peter Damoc (peter at sigmacore.net)
   6 #               adapted from Martin Fowler's MVP example
   7 # Created:      January 2006
   8 # Version:      0.2 
   9 # Licence:      wxWindows license
  10 
  11 class MockAlbumWindow(object):
  12     def __init__(self):
  13         '''
  14         Just a simple object to hold view status data
  15         Hint: if you have  setXXX in the original view you should have a field to hold that 
  16         '''
  17         self.title = ''
  18         self.artist = ''
  19         self.classical = False
  20         self.composer = ''
  21         self.composerIsEnabled = False
  22         self.apply = False
  23         self.cancel = False
  24         self.windowTitle = ''
  25         self.albums = []
  26         self.selected = -1
  27         self.orderLabel = ""
  28         
  29     def setTitle(self, title):
  30         self.title = title
  31         
  32     def setArtist(self, artist):
  33         self.artist = artist
  34         
  35     def setClassical(self, isClassical):
  36         self.classical = isClassical
  37         
  38     def setComposer(self, composer):
  39         self.composer = composer
  40         
  41     def setComposerEnabled(self, enabled):
  42         self.composerIsEnabled = enabled
  43         
  44     def setApplyEnabled(self, enabled):
  45         self.apply = enabled
  46         
  47     def setCancelEnabled(self, enabled):
  48         self.cancel = enabled
  49         
  50     def setWindowTitle(self, title):
  51         self.windowTitle = title
  52         
  53     def setAlbums(self, albums):
  54         self.albums = albums
  55         
  56     def setSelectedAlbum(self, albumIndex):
  57         self.albumIndex = albumIndex
  58         
  59     def setOrderLabel(self, label):
  60         self.orderLabel = label
  61         
  62     def getOrderLabel(self):
  63         return self.orderLabel
  64         
  65     def getTitle(self):
  66         return self.title
  67     
  68     def getArtist(self):
  69         return self.artist
  70         
  71     def getComposer(self):
  72         return self.composer
  73 
  74     def getSelectedAlbum(self):
  75         return self.albumIndex
  76 
  77     def isClassical(self):
  78         return self.classical
  79 
  80     def start(self):
  81         pass
  82 
  83 class MockAlbumInteractor:
  84     def Install(self, presenter, view):
  85         pass

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2009-10-04 09:16:02, 0.7 KB) [[attachment:albums.pyw]]
  • [get | view] (2009-10-04 09:16:02, 1.5 KB) [[attachment:interactors.py]]
  • [get | view] (2009-10-04 09:16:02, 2.3 KB) [[attachment:mock_objects.py]]
  • [get | view] (2009-10-04 09:16:02, 1.1 KB) [[attachment:models.py]]
  • [get | view] (2009-10-04 09:16:02, 12.4 KB) [[attachment:mvp.png]]
  • [get | view] (2009-10-04 09:16:02, 5.5 KB) [[attachment:mvp.zip]]
  • [get | view] (2009-10-04 09:16:02, 12.9 KB) [[attachment:mvp2.png]]
  • [get | view] (2009-10-04 09:16:02, 5.9 KB) [[attachment:mvp2.zip]]
  • [get | view] (2009-10-04 09:16:02, 3.8 KB) [[attachment:package.zip]]
  • [get | view] (2009-10-04 09:16:02, 4.4 KB) [[attachment:presenters.py]]
  • [get | view] (2009-10-04 09:16:02, 2.2 KB) [[attachment:test_presenters.py]]
  • [get | view] (2009-10-04 09:16:02, 4.3 KB) [[attachment:views.py]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.

NOTE: To edit pages in this wiki you must be a member of the TrustedEditorsGroup.