def test_transform_valid(self): job_clusters = job_clustering.JobClustering(config_test_match_exprs) output = job_clusters.transform(valid_q_datablock) pprint.pprint(output) db = output.get('job_clusters') assert db['Totals'].sum() == 7 assert db.shape[0] == 5
def test_transform_missing_q(self): job_clusters = job_clustering.JobClustering(config_test_match_exprs) output = job_clusters.transform(missing_q_datablock) pprint.pprint(output) db = output.get('job_clusters') assert db['Totals'].sum() == 0 assert db.shape[0] == 5 assert db.iloc[ 0, 0] == "VO_Name=='cms' and RequestCpus==1 and (MaxWallTimeMins>0 and MaxWallTimeMins<= 60*12)"
def test_consumes(self): consumes = ['job_manifests'] job_clusters = job_clustering.JobClustering(config_test_match_exprs) assert job_clusters.consumes() == consumes
def test_produces(self): produces = ['job_clusters'] job_clusters = job_clustering.JobClustering(config_test_match_exprs) assert job_clusters.produces() == produces
def test_consumes(self): job_clusters = job_clustering.JobClustering(config_test_match_exprs) assert job_clusters._consumes == {"job_manifests": pandas.DataFrame}
def test_produces(self): job_clusters = job_clustering.JobClustering(config_test_match_exprs) assert job_clusters._produces == {"job_clusters": pandas.DataFrame}