def testTftpPacketRRQ(self):
    log.debug('===> Running testcase testTftpPacketRRQ')
    options = {}
    rrq = tftpy.TftpPacketRRQ()
    rrq.filename = 'myfilename'
    rrq.mode = 'octet'
    rrq.options = options
    rrq.encode()
    self.assert_((rrq.buffer != None), 'Buffer populated')
    rrq.decode()
    self.assertEqual(rrq.filename, b'myfilename', 'Filename correct')
    self.assertEqual(rrq.mode, b'octet', 'Mode correct')
    self.assertEqual(rrq.options, options, 'Options correct')
    rrq.options = {'blksize': '1024'}
    rrq.filename = 'myfilename'
    rrq.mode = 'octet'
    rrq.encode()
    self.assert_((rrq.buffer != None), 'Buffer populated')
    rrq.decode()
    self.assertEqual(rrq.filename, b'myfilename', 'Filename correct')
    self.assertEqual(rrq.mode, b'octet', 'Mode correct')
    self.assertEqual(rrq.options['blksize'], '1024', 'Blksize correct')
def testTftpPacketRRQ(self):
    log.debug('===> Running testcase testTftpPacketRRQ')
    options = {}
    rrq = tftpy.TftpPacketRRQ()
    rrq.filename = 'myfilename'
    rrq.mode = 'octet'
    rrq.options = options
    rrq.encode()
    self.assert_((rrq.buffer != None), 'Buffer populated')
    rrq.decode()
    self.assertEqual(rrq.filename, b'myfilename', 'Filename correct')
    self.assertEqual(rrq.mode, b'octet', 'Mode correct')
    self.assertEqual(rrq.options, options, 'Options correct')
    rrq.options = {'blksize': '1024'}
    rrq.filename = 'myfilename'
    rrq.mode = 'octet'
    rrq.encode()
    self.assert_((rrq.buffer != None), 'Buffer populated')
    rrq.decode()
    self.assertEqual(rrq.filename, b'myfilename', 'Filename correct')
    self.assertEqual(rrq.mode, b'octet', 'Mode correct')
    self.assertEqual(rrq.options['blksize'], '1024', 'Blksize correct')