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.You are not allowed to attach a file to this page.