def testTftpPacketWRQ(self):
    log.debug('===> Running test case testTftpPacketWRQ')
    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.opcode, 2, 'Opcode correct')
    self.assertEqual(wrq.filename, b'myfilename', 'Filename correct')
    self.assertEqual(wrq.mode, b'octet', 'Mode correct')
    self.assertEqual(wrq.options, options, 'Options correct')
    wrq.options = {'blksize': '1024'}
    wrq.filename = 'myfilename'
    wrq.mode = 'octet'
    wrq.encode()
    self.assert_((wrq.buffer != None), 'Buffer populated')
    wrq.decode()
    self.assertEqual(wrq.opcode, 2, 'Opcode correct')
    self.assertEqual(wrq.filename, b'myfilename', 'Filename correct')
    self.assertEqual(wrq.mode, b'octet', 'Mode correct')
    self.assertEqual(wrq.options['blksize'], '1024', 'Blksize correct')
def testTftpPacketWRQ(self):
    log.debug('===> Running test case testTftpPacketWRQ')
    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.opcode, 2, 'Opcode correct')
    self.assertEqual(wrq.filename, b'myfilename', 'Filename correct')
    self.assertEqual(wrq.mode, b'octet', 'Mode correct')
    self.assertEqual(wrq.options, options, 'Options correct')
    wrq.options = {'blksize': '1024'}
    wrq.filename = 'myfilename'
    wrq.mode = 'octet'
    wrq.encode()
    self.assert_((wrq.buffer != None), 'Buffer populated')
    wrq.decode()
    self.assertEqual(wrq.opcode, 2, 'Opcode correct')
    self.assertEqual(wrq.filename, b'myfilename', 'Filename correct')
    self.assertEqual(wrq.mode, b'octet', 'Mode correct')
    self.assertEqual(wrq.options['blksize'], '1024', 'Blksize correct')