コード例 #1
0
def test_2(**kwds):

    from histogram.DictAttributeCont import AttributeCont
    attCont = AttributeCont()

    attCont.setAttribute('name', 'timmah!')

    passed = True
    name = attCont.getAttribute('name')
    if name != 'timmah!':
        passed = False
        log("value of 'name' attribute ({0!s}) was incorrect".format(name))

    return passed
コード例 #2
0
def test_2( **kwds):

    from histogram.DictAttributeCont import AttributeCont
    attCont = AttributeCont()

    attCont.setAttribute( 'name', 'timmah!')

    passed = True
    name = attCont.getAttribute('name')
    if name != 'timmah!':
        passed = False
        log("value of 'name' attribute (%s) was incorrect" % name)  
        
    return passed
コード例 #3
0
def test_1(**kwds):

    from histogram.DictAttributeCont import AttributeCont
    attCont = AttributeCont()

    attCont.setAttribute('name', 'timmah!')

    passed = True
    attDict = attCont._attributes
    try:
        name = attDict['name']
        if name != 'timmah!':
            passed = False
            log("value of 'name' attribute ({0!s}) was incorrect".format(name))
    except KeyError:
        passed = False
        log("did not store 'name' as a key")

    return passed
コード例 #4
0
def test_1( **kwds):

    from histogram.DictAttributeCont import AttributeCont
    attCont = AttributeCont()

    attCont.setAttribute( 'name', 'timmah!')

    passed = True
    attDict = attCont._attributes
    try:
        name = attDict['name']
        if name != 'timmah!':
            passed = False
            log("value of 'name' attribute (%s) was incorrect" % name)
    except KeyError:
        passed = False
        log("did not store 'name' as a key")
        
    return passed
コード例 #5
0
def test_3(**kwds):
    from histogram.DictAttributeCont import AttributeCont
    attCont = AttributeCont()

    attCont.setAttribute('name', 'timmah!')
    attCont.setAttribute('unit', 'tons')

    passed = True
    attList = ['name', 'unit']
    acList = attCont.listAttributes()
    if acList != attList:
        passed = False
        log("listAtts() returned {0!s}, should have been {1!s}".format(
            acList, attList))

    return passed
コード例 #6
0
def test_3( **kwds):
    from histogram.DictAttributeCont import AttributeCont
    attCont = AttributeCont()

    attCont.setAttribute( 'name', 'timmah!')
    attCont.setAttribute( 'unit', 'tons')

    passed = True
    attList = ['name', 'unit']
    acList = attCont.listAttributes()
    if acList != attList:
        passed = False
        log("listAtts() returned %s, should have been %s" %(acList, attList))
        
    return passed
コード例 #7
0
def test_0(**kwds):

    from histogram.DictAttributeCont import AttributeCont
    attCont = AttributeCont()
    return True