@@ -0,0 +1,1725 @@
+import os, json, unittest, time, shutil, sys%0Asys.path.extend(%5B'.','..','py'%5D)%0A%0Aimport h2o, h2o_cmd, h2o_hosts%0Aimport argparse%0A%0Aclass Basic(unittest.TestCase):%0A    def tearDown(self):%0A        h2o.check_sandbox_for_errors()%0A%0A    @classmethod%0A    def setUpClass(cls):%0A        localhost = h2o.decide_if_localhost()%0A        if (localhost):%0A            h2o.build_cloud(2)%0A        else:%0A            h2o_hosts.build_cloud_with_hosts()%0A%0A    @classmethod%0A    def tearDownClass(cls):%0A        h2o.tear_down_cloud()%0A%0A    def test_rf_model_key_unique(self):%0A        SYNDATASETS_DIR = h2o.make_syn_dir()%0A        modelKeyDict = %7B%7D%0A        for trial in xrange (1,5,1):%0A            csvPathname = h2o.find_file('smalldata/iris/iris2.csv')%0A            # key = h2o.nodes%5B0%5D.put_file(csvPathname)%0A            # parseKey = h2o.nodes%5B0%5D.parse(key, key + %22_%22 + str(trial) + %22.hex%22)%0A%0A            h2o.verboseprint(%22Trial%22, trial)%0A            start = time.time()%0A            # rfview=False used to inhibit the rfview completion%0A            rfResult = h2o_cmd.runRF(trees=6, timeoutSecs=10, rfview=False, csvPathname=csvPathname)%0A            print %22RF #%25d%22 %25 trial,  %22started on %22, csvPathname, 'took', time.time() - start, 'seconds'%0A            model_key = rfResult%5B'model_key'%5D%0A            print %22model_key:%22, model_key%0A            if model_key in modelKeyDict:%0A                raise Exception(%22same model_key used in RF #%25d that matches prior RF #%25d%22 %25 (trial, modelKeyDict%5Bmodel_key%5D))%0A            modelKeyDict%5Bmodel_key%5D = trial%0A%0A        # just show the jobs still going, if any. maybe none, because short (iris)%0A        a = h2o.nodes%5B0%5D.jobs_admin()%0A        print %22jobs_admin():%22, h2o.dump_json(a)%0A%0A%0Aif __name__ == '__main__':%0A    h2o.unit_main()%0A%0A

test for unique rf model_key names