def newMapWidgetInContainer(self): """ Return a new SVGMap """ enc = ircweb.IRCContainer(None, testUser(cleanStore())) enc.setFragmentParent(self) return enc
def newAccountManager(self, nick=None, autoHide=None): """ Return a new Account Manager """ user = testUser(cleanStore()) if nick is not None: user.nick = nick am = ircweb.AccountManager(MockMinAccountManager(), None, user) am.setFragmentParent(self) return am
def newContainer(self, ): """ Return a new IRC Container with mock conversations for the ids given """ user = testUser(cleanStore()) # XXX warning - livetrial does not provide test isolation! # setting instance variables can bite you in the ass. If this # method is called first from every test, life is fine, but if # generateConversation is called without calling this first, # behavior is UNDEFINED. self.irc = ircweb.IRCContainer(MockMinAccountManager(), user) self.irc.setFragmentParent(self) return self.irc
def newContainer(self,): """ Return a new IRC Container with mock conversations for the ids given """ user = testUser(cleanStore()) # XXX warning - livetrial does not provide test isolation! # setting instance variables can bite you in the ass. If this # method is called first from every test, life is fine, but if # generateConversation is called without calling this first, # behavior is UNDEFINED. self.irc = ircweb.IRCContainer(MockMinAccountManager(), user) self.irc.setFragmentParent(self) return self.irc
def newFileChooser(self, labels=None): """ Return a new Signup widget @param labels: create ChooserIcons with the given labels as well """ # if labels was given, create some test files. FileChooser # will make ChooserIcons out of these during rendering self.store = cleanStore() self.user = testUser(self.store) if labels is not None: for label in labels: fileitem = data.FileMeta(store=self.store, user=self.user, filename=label, mimeType=u"text/plain") self.fc = gmtools.FileChooser(self.user) self.fc.setFragmentParent(self) return self.fc
def newFileChooser(self, labels=None): """ Return a new Signup widget @param labels: create ChooserIcons with the given labels as well """ # if labels was given, create some test files. FileChooser # will make ChooserIcons out of these during rendering self.store = cleanStore() self.user = testUser(self.store) if labels is not None: for label in labels: fileitem = data.FileMeta(store=self.store, user=self.user, filename=label, mimeType=u'text/plain') self.fc = gmtools.FileChooser(self.user) self.fc.setFragmentParent(self) return self.fc