def test_get_variables1():
    """py.test for get_variables1"""

    def _double(n):
        return n * 2

    data = (
        (
            "./eplussql_test/eplussql.sql",
            6,
            None,
            [11.1, 10.4125, 9.625],
        ),  # fname, ReportVariableDataDictionaryIndex, func, threevars
        (
            "./eplussql_test/eplussql.sql",
            6,
            _double,
            [22.2, 20.8250, 19.250],
        ),  # fname, ReportVariableDataDictionaryIndex, func, threevars
    )
    for fname, ReportVariableDataDictionaryIndex, func, threevars in data:
        cursor = eplussql.getcursor(fname)
        result = eplussql.get_variables1(cursor, ReportVariableDataDictionaryIndex, func)
        threeresult = result[-6:-3]
        assert threeresult == threevars
示例#2
0
import eplussql
fname = './eplussql_test/eplussql1.sql'
fname = '/Volumes/Server/Staff/Santosh/transfer/eplussql_stuff/eplussql1.sql'
cursor = eplussql.getcursor(fname)

ReportVariableDataDictionaryIndex = 8

rows = eplussql.get_variables1(cursor, ReportVariableDataDictionaryIndex)

print rows[:150]