Exemplo n.º 1
0
def tests_tu(options):
    titre_test = "UNDEFINED"  
    
    curdir,sqldir,resultsdir,expecteddir = utilt.get_paths()

    try:
        utilt.wait_for_true(srvob_conf.dbBO,0.1,"SELECT value=102,value FROM market.tvar WHERE name='OC_CURRENT_PHASE'",
            msg="Waiting for market opening")
    except psycopg2.OperationalError,e:
        print "Please adjust DB_NAME,DB_USER,DB_PWD,DB_PORT parameters of the file src/test/py/srv_conf.py"
        print "The test program could not connect to the market"
        exit(1)
Exemplo n.º 2
0
def tests_tu(options):
    titre_test = "UNDEFINED"

    curdir, sqldir, resultsdir, expecteddir = utilt.get_paths()

    try:
        utilt.wait_for_true(
            srvob_conf.dbBO,
            0.1,
            "SELECT value=102,value FROM market.tvar WHERE name='OC_CURRENT_PHASE'",
            msg="Waiting for market opening")
    except psycopg2.OperationalError, e:
        print "Please adjust DB_NAME,DB_USER,DB_PWD,DB_PORT parameters of the file src/test/py/srv_conf.py"
        print "The test program could not connect to the market"
        exit(1)
Exemplo n.º 3
0
        _terr +=1
        _num_test +=1
        
        file_result = file_test[:-4]+'.res'
        _fte = os.path.join(resultsdir,file_result)
        _fre = os.path.join(expecteddir,file_result)
        
        with open(_fte,'w') as f:        
            cur = None

            dump = utilt.Dumper(srvob_conf.dbBO,options,None)
            titre_test = utilt.exec_script(dump,sqldir,'reset_market.sql')
            dump = utilt.Dumper(srvob_conf.dbBO,options,f)
            titre_test = utilt.exec_script(dump,sqldir,file_test)

            utilt.wait_for_true(srvob_conf.dbBO,20,"SELECT market.fstackdone()")

            conn = molet.DbData(srvob_conf.dbBO)
            try:
                with molet.DbCursor(conn) as cur:
                    dump.torder(cur)
                    dump.tmsg(cur)

            finally:
                conn.close()

        if(os.path.exists(_fre)):
            if(utilt.files_clones(_fte,_fre)):
                _tok +=1
                _terr -=1
                print '%i\tY\t%s\t%s' % (_num_test,_nom_test,titre_test)
Exemplo n.º 4
0
        _terr += 1
        _num_test += 1

        file_result = file_test[:-4] + '.res'
        _fte = os.path.join(resultsdir, file_result)
        _fre = os.path.join(expecteddir, file_result)

        with open(_fte, 'w') as f:
            cur = None

            dump = utilt.Dumper(srvob_conf.dbBO, options, None)
            titre_test = utilt.exec_script(dump, sqldir, 'reset_market.sql')
            dump = utilt.Dumper(srvob_conf.dbBO, options, f)
            titre_test = utilt.exec_script(dump, sqldir, file_test)

            utilt.wait_for_true(srvob_conf.dbBO, 20,
                                "SELECT market.fstackdone()")

            conn = molet.DbData(srvob_conf.dbBO)
            try:
                with molet.DbCursor(conn) as cur:
                    dump.torder(cur)
                    dump.tmsg(cur)

            finally:
                conn.close()

        if (os.path.exists(_fre)):
            if (utilt.files_clones(_fte, _fre)):
                _tok += 1
                _terr -= 1
                print '%i\tY\t%s\t%s' % (_num_test, _nom_test, titre_test)