Added test for WRQ packet
git-svn-id: https://tftpy.svn.sourceforge.net/svnroot/tftpy/trunk@21 63283fd4-ec1e-0410-9879-cb7f675518da
This commit is contained in:
parent
6ebd6fcbc8
commit
2e42f990c0
1 changed files with 13 additions and 0 deletions
13
test/test.py
13
test/test.py
|
@ -22,5 +22,18 @@ class TestTftpy(unittest.TestCase):
|
|||
self.assertEqual(rrq.mode, "octet", "Mode correct")
|
||||
self.assertEqual(rrq.options, options, "Options correct")
|
||||
|
||||
def testTftpPacketWRQ(self):
|
||||
options = {}
|
||||
wrq = tftpy.TftpPacketWRQ()
|
||||
wrq.filename = 'myfilename'
|
||||
wrq.mode = 'octet'
|
||||
wrq.options = options
|
||||
wrq.encode()
|
||||
self.assert_(wrq.buffer != None, "Buffer populated")
|
||||
wrq.decode()
|
||||
self.assertEqual(wrq.filename, "myfilename", "Filename correct")
|
||||
self.assertEqual(wrq.mode, "octet", "Mode correct")
|
||||
self.assertEqual(wrq.options, options, "Options correct")
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
|
Reference in a new issue