Added test for WRQ packet

git-svn-id: https://tftpy.svn.sourceforge.net/svnroot/tftpy/trunk@21 63283fd4-ec1e-0410-9879-cb7f675518da
master
msoulier 2006-10-09 02:47:59 +00:00
parent 6ebd6fcbc8
commit 2e42f990c0
1 changed files with 13 additions and 0 deletions

View File

@ -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()