TestDatagramEntryPoint.py 740 Bytes
import unittest
import mock

from os.path import dirname, realpath
from sys import argv, path
path.append(dirname(dirname(realpath(__file__))) + '/lib')

from Communication.DatagramEntryPoint import DatagramEntryPoint

class TestDatagramEntryPoint(unittest.TestCase):
    def setUp(self):
        self._transport = mock.Mock()
        self._protocol  = mock.Mock()
        self._entrypoint = DatagramEntryPoint(self._transport, self._protocol)

    def testAny(self):
        self._transport.bind.assert_called_once_with()

def suite():
    return unittest.TestLoader().loadTestsFromTestCase(TestDatagramEntryPoint)

if __name__ == '__main__':
    unittest.TextTestRunner(verbosity=2).run(suite())

# vim: set ft=python et ts=8 sw=4 sts=4: