Example #1
0
 def testBadMarker(self):
     c = ModelTrainCommand()
     c.params.partner = PartnerAuthInfo(None)
     c.params.message = TransitMessage(serialized={ 'text' : u'Is this SPAM?'})
     c.params.marker = '?'
     c.params.model = 'testModel'
     return c.run().addCallback(lambda _: self.assert_(False)).addErrback(lambda failure: failure.trap("spamfighter.core.commands.errors.TypeParameterException"))
Example #2
0
 def testRun(self):
     c = ModelTrainCommand()
     c.params.partner = PartnerAuthInfo(None)
     c.params.message = TransitMessage(serialized={ 'text' : u'Is this SPAM?'})
     c.params.marker = 'bad'
     c.params.model = 'testModel'
     return c.run()