add tests for x224 layer

This commit is contained in:
speyrefitte
2014-11-04 16:32:40 +01:00
parent 71d5fc5344
commit be77dfb92f
5 changed files with 312 additions and 55 deletions

View File

@@ -29,21 +29,21 @@ import unittest
import rdpy.network.layer
class LayerCase(unittest.TestCase):
'''
represent test case for all classes and function
present in rdpy.network.layer
'''
"""
@summary: represent test case for all classes and function
present in rdpy.network.layer
"""
class LayerCaseException(Exception):
'''
exception use for event base test
'''
"""
@summary: exception use for event base test
"""
pass
def test_layer_connect_event(self):
'''
test if connect event is send from transport to presentation
'''
"""
@summary: test if connect event is send from transport to presentation
"""
class TestConnect(rdpy.network.layer.Layer):
def connect(self):
raise LayerCase.LayerCaseException()
@@ -51,9 +51,9 @@ class LayerCase(unittest.TestCase):
self.assertRaises(LayerCase.LayerCaseException, rdpy.network.layer.Layer(presentation = TestConnect()).connect)
def test_layer_automata_more_than_expected(self):
'''
test layer automata mechanism if data received is more than expected
'''
"""
@summary: test layer automata mechanism if data received is more than expected
"""
class TestAutomata(rdpy.network.layer.RawLayer):
def expectedCallBack(self, data):
if data.dataLen() == 4:
@@ -64,9 +64,9 @@ class LayerCase(unittest.TestCase):
self.assertRaises(LayerCase.LayerCaseException, t.dataReceived, "\x00\x00\x00\x00\x00")
def test_layer_automata_less_than_expected(self):
'''
test layer automata mechanism
'''
"""
@summary: test layer automata mechanism
"""
class TestAutomata(rdpy.network.layer.RawLayer):
def expectedCallBack(self, data):
if data.dataLen() == 4: