# Copyright (C) 2006-2012 Mortal Coil Games # See LICENSE for details. # -*- test-case-name: mv3d.test.test_event -*- """ Event Testing """ from twisted.trial.unittest import TestCase from mv3d.reporter.event import Event from mv3d.util.date import Date from mv3d.net.client import ServiceLoc class namey: """ You need to add a docstring here ! """ def __init__(self, n): self.name = n def getName(self): """ You need to add a docstring here ! """ return self.name class EvenTests(TestCase): """ You need to add a docstring here ! """ def test_Constructor(self): """ You need to add a docstring here ! """ t = Event() self.failUnless(isinstance(t.date, Date)) self.assertEqual(t.category, "") self.assertEqual(len(t.prepositions), 0) def test_getHash(self): """ You need to add a docstring here ! """ t = Event() e = Event() s = ServiceLoc() s.name = u"Some server" s.host = u"127.0.0.1" s.port = 2314 t.setServer(s) e.setServer(s) t.category = "Test" e.category = "Test" s = namey("Something") o = namey("Otherthing") e.setSubject(s) t.setSubject(s) e.setObject(o) t.setObject(o) e.setVerb("ate") t.setVerb("ate") self.assertEqual(t.getHash(), e.getHash()) e.setVerb("made") self.assertNotEqual(t.getHash(), e.getHash()) def test_withUnicode(self): t = Event() t.setSubject(u"hello") t.setVerb(u"ate") t.setObject(u"something") t.getHash()