Example #1
0
def test_snowflakehandler_log():

    with FractalSnowflakeHandler() as server:
        proc = server._qcfractal_proc

        assert "No SSL files passed in" in server.show_log(show=False, nlines=100)
        assert "0 task" not in server.show_log(show=False, nlines=100)

    assert proc.poll() is not None
Example #2
0
def test_snowflakehandler_restart():

    with FractalSnowflakeHandler() as server:
        server.client()
        proc1 = server._qcfractal_proc

        server.restart()

        server.client()
        proc2 = server._qcfractal_proc

    assert proc1 != proc2
    assert proc1.poll() is not None
    assert proc2.poll() is not None
Example #3
0
def test_snowflake_service():
    with FractalSnowflakeHandler() as server:

        client = server.client()

        hooh = ptl.data.get_molecule("hooh.json")

        # Geometric options
        tdinput = {
            "initial_molecule": [hooh],
            "keywords": {
                "dihedrals": [[0, 1, 2, 3]],
                "grid_spacing": [90]
            },
            "optimization_spec": {
                "program": "geometric",
                "keywords": {
                    "coordsys": "tric"
                }
            },
            "qc_spec": {
                "driver": "gradient",
                "method": "UFF",
                "basis": None,
                "keywords": None,
                "program": "rdkit"
            },
        }

        ret = client.add_service([tdinput])

        def geometric_await():
            td = client.query_procedures(id=ret.ids)[0]
            return td.status == "COMPLETE"

        assert await_true(60, geometric_await,
                          period=2), client.query_procedures(id=ret.ids)[0]