'Test options lookup with fixed options set (dict)'

def testFixedOptionsSet(self):

    assertEqual = self.assertEqual
    assertTrue = self.assertTrue
    table = current.db.fotest_table
    xml = current.xml
    fo = xml.get_field_options(table, 'fixed_set')
    assertTrue(isinstance(fo, etree._Element))
    assertEqual(fo.tag, 'select')
    ATTRIBUTE = xml.ATTRIBUTE
    VALUE = ATTRIBUTE.value
    options = self.options
    has_empty = False
    self.assertEqual(len(fo), (len(options) + 1))
    for opt in fo:
        assertEqual(opt.tag, 'option')
        attr = opt.attrib
        assertTrue((VALUE in attr))
        value = attr[VALUE]
        if (value == ''):
            has_empty = True
            assertEqual(opt.text, '')
            continue
        else:
            value = int(value)
        assertTrue((value in options))
        assertEqual(opt.text, options[value])
    assertTrue(has_empty, msg='Empty-option    missing')
