コード例 #1
0
ファイル: test_img.py プロジェクト: sediyev/PyXML
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLImageElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    i = doc.createElement('IMG')

    print 'testing get/set'
    testAttribute(i, 'lowSrc')
    testAttribute(i, 'alt')
    testAttribute(i, 'border')
    testAttribute(i, 'height')
    testAttribute(i, 'hspace')
    testIntAttribute(i, 'isMap')
    testAttribute(i, 'longDesc')
    testAttribute(i, 'src')
    testAttribute(i, 'useMap')
    testAttribute(i, 'vspace')
    testAttribute(i, 'width')

    i._set_align('left')
    rt = i._get_align()
    if rt != 'Left':
        error('get/set align failed')
    print 'get/set works'
コード例 #2
0
ファイル: test_img.py プロジェクト: Birdbird/StartPage
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLImageElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    i = doc.createElement('IMG')

    print 'testing get/set'
    testAttribute(i,'lowSrc')
    testAttribute(i,'alt')
    testAttribute(i,'border')
    testAttribute(i,'height')
    testAttribute(i,'hspace')
    testIntAttribute(i,'isMap')
    testAttribute(i,'longDesc')
    testAttribute(i,'src')
    testAttribute(i,'useMap')
    testAttribute(i,'vspace')
    testAttribute(i,'width')

    i._set_align('left')
    rt = i._get_align()
    if rt != 'Left':
        error('get/set align failed')
    print 'get/set works'
コード例 #3
0
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLObjectElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    o = doc.createElement('OBJECT')

    print 'testing get/set'
    testAttribute(o, 'code')
    testAttribute(o, 'archive')
    testAttribute(o, 'border')
    testAttribute(o, 'codeBase')
    testAttribute(o, 'codeType')
    testAttribute(o, 'data')
    testIntAttribute(o, 'declare')
    testAttribute(o, 'height')
    testAttribute(o, 'hspace')
    testAttribute(o, 'standby')
    testIntAttribute(o, 'tabIndex')
    testAttribute(o, 'type')
    testAttribute(o, 'useMap')
    testAttribute(o, 'vspace')
    testAttribute(o, 'width')
    o._set_align('left')
    rt = o._get_align()
    if rt != 'Left':
        error('get/set align failed')
    print 'get/set works'
コード例 #4
0
ファイル: test_pre.py プロジェクト: Birdbird/StartPage
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLPreElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    p = doc.createElement('PRE')

    print 'testing get/set'
    testIntAttribute(p,'width')
    print 'get/set works'
コード例 #5
0
ファイル: test_menu.py プロジェクト: sediyev/PyXML
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLMenuElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    m = doc.createElement('MENU')

    print 'testing get/set'
    testIntAttribute(m, 'compact')
    print 'get/set works'
コード例 #6
0
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLPreElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    p = doc.createElement('PRE')

    print 'testing get/set'
    testIntAttribute(p, 'width')
    print 'get/set works'
コード例 #7
0
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLDListElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    d = doc.createElement('DL')

    print 'testing get and set'
    testIntAttribute(d,'compact')
    print 'get/set works'
コード例 #8
0
ファイル: test_menu.py プロジェクト: Birdbird/StartPage
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLMenuElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    m = doc.createElement('MENU')

    print 'testing get/set'
    testIntAttribute(m,'compact')
    print 'get/set works'
コード例 #9
0
ファイル: test_li.py プロジェクト: Birdbird/StartPage
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLLIElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    l = doc.createElement('LI')

    print 'testing get/set'

    testAttribute(l,'type')
    testIntAttribute(l,'value')

    print 'get/set works'
コード例 #10
0
ファイル: test_ul.py プロジェクト: sediyev/PyXML
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLUListElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    u = doc.createElement('UL')

    print 'testing get/set'
    testIntAttribute(u, 'compact')

    u._set_type('ordered')
    rt = u._get_type()
    if rt != 'Ordered':
        error('get/set of type failed')
    print 'get/set works'
コード例 #11
0
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLButtonElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    b = doc.createElement('Button');

    print 'testing get/set attributes'

    testAttribute(b,'accessKey');
    testIntAttribute(b,'disabled');
    testAttribute(b,'name');
    testIntAttribute(b,'tabIndex');
    testAttribute(b,'value');
    print 'get/sets works'
コード例 #12
0
ファイル: test_hr.py プロジェクト: sediyev/PyXML
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLHRElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    h = doc.createElement('HR')

    print 'testing get/set'
    h._set_align('left')
    rt = h._get_align()
    if rt != 'Left':
        error('get/set align failed')
    testIntAttribute(h, 'noShade')
    testAttribute(h, 'size')
    testAttribute(h, 'width')
    print 'get/set works'
コード例 #13
0
ファイル: test_hr.py プロジェクト: Birdbird/StartPage
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLHRElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    h = doc.createElement('HR')

    print 'testing get/set'
    h._set_align('left')
    rt = h._get_align()
    if rt != 'Left':
        error('get/set align failed')
    testIntAttribute(h,'noShade')
    testAttribute(h,'size')
    testAttribute(h,'width')
    print 'get/set works'
コード例 #14
0
ファイル: test_script.py プロジェクト: Birdbird/StartPage
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLScriptElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    s = doc.createElement('SCRIPT')

    print "testing get/set"

    testAttribute(s,'text')
    testAttribute(s,'charset')
    testAttribute(s,'src')
    testAttribute(s,'type')
    testIntAttribute(s,'defer')

    print "get/sets work"
コード例 #15
0
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLScriptElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    s = doc.createElement('SCRIPT')

    print "testing get/set"

    testAttribute(s, 'text')
    testAttribute(s, 'charset')
    testAttribute(s, 'src')
    testAttribute(s, 'type')
    testIntAttribute(s, 'defer')

    print "get/sets work"
コード例 #16
0
ファイル: test_ul.py プロジェクト: janbrohl/PyXML
def test():
    print "testing source code syntax"
    from xml.dom.html import HTMLUListElement
    from xml.dom import implementation

    doc = implementation.createHTMLDocument("Title")
    u = doc.createElement("UL")

    print "testing get/set"
    testIntAttribute(u, "compact")

    u._set_type("ordered")
    rt = u._get_type()
    if rt != "Ordered":
        error("get/set of type failed")
    print "get/set works"
コード例 #17
0
ファイル: test_td.py プロジェクト: sediyev/PyXML
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')
コード例 #18
0
ファイル: test_td.py プロジェクト: Birdbird/StartPage
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')
コード例 #19
0
ファイル: test_frame.py プロジェクト: Birdbird/StartPage
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLFrameElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    f = doc.createElement('Frame')

    print 'testing get/set'
    testAttribute(f,'longDesc')
    testAttribute(f,'marginHeight')
    testAttribute(f,'marginWidth')
    testIntAttribute(f,'noResize')
    testAttribute(f,'src')
    f._set_frameBorder('left')
    rt = f._get_frameBorder()
    if rt != 'Left':
        error('get/set frameBorder failed')
    f._set_scrolling('auto')
    rt = f._get_scrolling()
    if rt != 'Auto':
        error('get/set scrolling failed')
    print 'get/set works'
コード例 #20
0
ファイル: test_frame.py プロジェクト: sediyev/PyXML
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLFrameElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    f = doc.createElement('Frame')

    print 'testing get/set'
    testAttribute(f, 'longDesc')
    testAttribute(f, 'marginHeight')
    testAttribute(f, 'marginWidth')
    testIntAttribute(f, 'noResize')
    testAttribute(f, 'src')
    f._set_frameBorder('left')
    rt = f._get_frameBorder()
    if rt != 'Left':
        error('get/set frameBorder failed')
    f._set_scrolling('auto')
    rt = f._get_scrolling()
    if rt != 'Auto':
        error('get/set scrolling failed')
    print 'get/set works'
コード例 #21
0
ファイル: test_textarea.py プロジェクト: Birdbird/StartPage
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLTextAreaElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    t = doc.createElement('TEXTAREA')

    print 'testing get/set of attributes'
    testAttribute(t,'defaultValue');
    testAttribute(t,'accessKey');
    testIntAttribute(t,'cols');
    testIntAttribute(t,'disabled');
    testAttribute(t,'name');
    testIntAttribute(t,'readonly');
    testIntAttribute(t,'rows');
    testIntAttribute(t,'tabIndex');
    print 'get/set work'

    print 'testing clone node'
    t2 = t.cloneNode(1)
    if t2._get_defaultValue() != t._get_defaultValue():
        error('cloneNode did not set the default value');
    print 'cloneNode works'
コード例 #22
0
ファイル: test_a.py プロジェクト: Birdbird/StartPage
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLAnchorElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    a = doc.createElement('A')

    print 'testing get/set'
    testAttribute(a,'accessKey')
    testAttribute(a,'charset')
    testAttribute(a,'coords')
    testAttribute(a,'href')
    testAttribute(a,'hreflang')
    testAttribute(a,'rel')
    testAttribute(a,'rev')
    testIntAttribute(a,'tabIndex')
    testAttribute(a,'target')
    testAttribute(a,'type')
    a._set_shape('rect')
    rt = a._get_shape()
    if rt != 'Rect':
        error('get/set shape failed')
    print 'get/set works'
コード例 #23
0
ファイル: test_a.py プロジェクト: sediyev/PyXML
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLAnchorElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    a = doc.createElement('A')

    print 'testing get/set'
    testAttribute(a, 'accessKey')
    testAttribute(a, 'charset')
    testAttribute(a, 'coords')
    testAttribute(a, 'href')
    testAttribute(a, 'hreflang')
    testAttribute(a, 'rel')
    testAttribute(a, 'rev')
    testIntAttribute(a, 'tabIndex')
    testAttribute(a, 'target')
    testAttribute(a, 'type')
    a._set_shape('rect')
    rt = a._get_shape()
    if rt != 'Rect':
        error('get/set shape failed')
    print 'get/set works'
コード例 #24
0
ファイル: test_area.py プロジェクト: sediyev/PyXML
def test():
    print "testing syntax"
    from xml.dom.html.HTMLAreaElement import HTMLAreaElement

    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')

    p = doc.createElement('Area')

    print "testing get/set"

    testAttribute(p, 'accessKey')
    testAttribute(p, 'alt')
    testAttribute(p, 'coords')
    testAttribute(p, 'href')
    testAttribute(p, 'target')
    testIntAttribute(p, 'noHref')
    testIntAttribute(p, 'tabIndex')
    p._set_shape('circle')
    rt = p._get_shape()
    if rt != 'Circle':
        error('get/set shape failed')
    print "get/sets work"
コード例 #25
0
ファイル: test_textarea.py プロジェクト: sediyev/PyXML
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLTextAreaElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    t = doc.createElement('TEXTAREA')

    print 'testing get/set of attributes'
    testAttribute(t, 'defaultValue')
    testAttribute(t, 'accessKey')
    testIntAttribute(t, 'cols')
    testIntAttribute(t, 'disabled')
    testAttribute(t, 'name')
    testIntAttribute(t, 'readonly')
    testIntAttribute(t, 'rows')
    testIntAttribute(t, 'tabIndex')
    print 'get/set work'

    print 'testing clone node'
    t2 = t.cloneNode(1)
    if t2._get_defaultValue() != t._get_defaultValue():
        error('cloneNode did not set the default value')
    print 'cloneNode works'
コード例 #26
0
ファイル: test_col.py プロジェクト: sediyev/PyXML
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLTableColElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    c = doc.createElement('COL')

    print 'testing get/set'
    testAttribute(c, 'ch')
    testAttribute(c, 'chOff')
    testIntAttribute(c, 'span')
    testAttribute(c, 'width')

    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 vAlign failed')

    print 'get/set works'
コード例 #27
0
ファイル: test_col.py プロジェクト: Birdbird/StartPage
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLTableColElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    c = doc.createElement('COL');

    print 'testing get/set'
    testAttribute(c,'ch');
    testAttribute(c,'chOff');
    testIntAttribute(c,'span');
    testAttribute(c,'width');

    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 vAlign failed')

    print 'get/set works'
コード例 #28
0
ファイル: test_input.py プロジェクト: sediyev/PyXML
def test():
    print 'testing source code syntax'
    from xml.dom.html import HTMLInputElement
    from xml.dom import implementation
    doc = implementation.createHTMLDocument('Title')
    f = doc.createElement('Form')

    text = doc.createElement('Input')
    text.setAttribute('TYPE','TEXT')

    radio = doc.createElement('Input')
    radio.setAttribute('TYPE','RADIO')

    image = doc.createElement('Input')
    image.setAttribute('TYPE','IMAGE')

    f.appendChild(text)
    f.appendChild(radio)
    f.appendChild(image)

    print 'testing generic get/set functions'
    testAttribute(text,'defaultValue')
    testAttribute(text,'accept')
    testAttribute(text,'accessKey')
    testAttribute(text,'alt')
    testAttribute(text,'name')
    testAttribute(text,'size')
    testAttribute(image,'src')
    testAttribute(text,'useMap')
    testAttribute(text,'value')

    text._set_align('left')
    rt = text._get_align()
    if rt != 'Left':
        error('get/set of align failed')

    if image._get_type() != 'Image':
        error('get of type failed')

    print 'get/set works'

    print 'testing int Attributes'
    testIntAttribute(radio,'defaultChecked');
    testIntAttribute(radio,'checked');
    testIntAttribute(radio,'disabled');
    testIntAttribute(text,'maxLength');
    testIntAttribute(text,'readOnly');
    testIntAttribute(text,'tabIndex');

    print 'Int get/sets work'

    print "testing cloneNode"
    i2 = radio.cloneNode(0);
    if i2._get_defaultChecked() != radio._get_defaultChecked():
        error('cloneNode failed to copy defaultChecked')
    i3 = text.cloneNode(0)
    if i3._get_defaultValue() != text._get_defaultValue():
        error('cloneNode failed to copy defaultValue')
    print 'cloneNode works'