1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
from util import testAttribute
from util import testIntAttribute
def test():
print 'testing source code syntax'
from xml.dom.html import HTMLTableCellElement
from xml.dom import implementation
doc = implementation.createHTMLDocument('Title')
c = doc.createElement('TD')
print 'testing get/set'
testAttribute(c,'abbr');
testAttribute(c,'axis');
testAttribute(c,'bgColor');
testAttribute(c,'ch');
testAttribute(c,'chOff');
testIntAttribute(c,'colSpan');
testAttribute(c,'headers');
testAttribute(c,'height');
testIntAttribute(c,'noWrap');
testIntAttribute(c,'rowSpan');
testAttribute(c,'width');
print 'get/set works'
c._set_align('left')
rt = c._get_align()
if rt != 'Left':
error('get/set align failed')
c._set_vAlign('top')
rt = c._get_vAlign()
if rt != 'Top':
error('get/set align failed')
c._set_scope('colgroup')
rt = c._get_scope()
if rt != 'Colgroup':
error('get/set align failed')
#getCells is tested in the TR test file
if __name__ == '__main__':
test();
|