def test_acquire_bad_with_timeout():
    fg = factory_global.FactoryGlobalManifests(CONFIG_BAD_WITH_TIMEOUT)
    start = time.time()
    fg_df = fg.acquire()
    end = time.time()
    # Set by tuning max_retries and the retry_interval
    assert end - start > 5
    assert (fg_df["factoryglobal_manifests"] is None) or (len(fg_df["factoryglobal_manifests"]) == 0)
 def test_acquire_bad(self):
     fg = factory_global.FactoryGlobalManifests(CONFIG_BAD)
     fg_df = fg.acquire()
     assert((fg_df['factoryglobal_manifests'] is None) or
            (len(fg_df['factoryglobal_manifests']) == 0))
 def test_acquire_live(self):
     fg = factory_global.FactoryGlobalManifests(CONFIG)
     pprint.pprint(fg.acquire())
 def test_acquire(self):
     fg = factory_global.FactoryGlobalManifests(CONFIG)
     with mock.patch.object(htcondor_query.CondorStatus, 'fetch') as f:
         f.return_value = utils.input_from_file(FIXTURE_FILE)
         pprint.pprint(fg.acquire())
 def test_produces(self):
     fg = factory_global.FactoryGlobalManifests(CONFIG)
     assert fg._produces == {'factoryglobal_manifests': pandas.DataFrame}
예제 #6
0
 def test_produces(self):
     fg = factory_global.FactoryGlobalManifests(CONFIG)
     produces = ['factoryglobal_manifests']
     assert(fg.produces() == produces)
 def test_acquire(self):
     fg = factory_global.FactoryGlobalManifests(config)
     with mock.patch.object(htcondor_query.CondorStatus, 'fetch') as f:
         f.return_value = utils.input_from_file('factory_global.cs.fixture')
         pprint.pprint(fg.acquire())