def test_acquire():
    nersc_job_info = NerscJobInfo.NerscJobInfo(CONFIG)
    with mock.patch.object(newt.Newt, "get_status") as get_status:
        get_status.return_value = utils.input_from_file(STATUS_FIXTURE_FILE)
        with mock.patch.object(newt.Newt, "get_queue") as get_queue:
            get_queue.return_value = utils.input_from_file(JOBS_FIXTURE_FILE)
            res = nersc_job_info.acquire()
            verify_products(nersc_job_info, res)
            new_df = res["Nersc_Job_Info"]
            new_df = new_df.reindex(EXPECTED_PANDAS_DFRAME.columns, axis=1)
            pandas.testing.assert_frame_equal(EXPECTED_PANDAS_DFRAME, new_df)
 def test_acquire(self):
     nersc_job_info = NerscJobInfo.NerscJobInfo(CONFIG)
     with mock.patch.object(newt.Newt, "get_status") as get_status:
         get_status.return_value = utils.input_from_file(
             STATUS_FIXTURE_FILE)
         with mock.patch.object(newt.Newt, "get_queue") as get_queue:
             get_queue.return_value = utils.input_from_file(
                 JOBS_FIXTURE_FILE)
             res = nersc_job_info.acquire()
             assert PRODUCES == list(res.keys())
             assert EXPECTED_PANDAS_DFRAME.equals(res[PRODUCES[0]])
Exemplo n.º 3
0
    def test_acquire(self):
        nersc_job_info = NerscJobInfo.NerscJobInfo(config)

        with mock.patch.object(newt.Newt, 'get_status') as get_status:
            get_status.return_value = utils.input_from_file(
                'newt_status.cs.fixture')
            with mock.patch.object(newt.Newt, 'get_queue') as get_queue:
                get_queue.return_value = utils.input_from_file(
                    'newt_jobs.cs.fixture')
                res = nersc_job_info.acquire()
                assert produces == res.keys()
                assert expected_pandas_dframe.equals(res[produces[0]])
 def test_acquire(self):
     nersc_job_info = NerscJobInfo.NerscJobInfo(CONFIG)
     with mock.patch.object(newt.Newt, "get_status") as get_status:
         get_status.return_value = utils.input_from_file(
             STATUS_FIXTURE_FILE)
         with mock.patch.object(newt.Newt, "get_queue") as get_queue:
             get_queue.return_value = utils.input_from_file(
                 JOBS_FIXTURE_FILE)
             res = nersc_job_info.acquire()
             assert PRODUCES == list(res.keys())
             new_df = res[PRODUCES[0]]
             new_df = new_df.reindex(EXPECTED_PANDAS_DFRAME.columns, axis=1)
             pandas.testing.assert_frame_equal(EXPECTED_PANDAS_DFRAME,
                                               new_df)
Exemplo n.º 5
0
 def test_produces(self):
     nersc_job_info = NerscJobInfo.NerscJobInfo(config)
     assert nersc_job_info.produces() == produces
def test_produces():
    nersc_job_info = NerscJobInfo.NerscJobInfo(CONFIG)
    assert nersc_job_info._produces == _PRODUCES
 def test_produces(self):
     nersc_job_info = NerscJobInfo.NerscJobInfo(CONFIG)
     assert nersc_job_info.produces() == PRODUCES