Broke out cli user add test from cli user show test
@@ -37,17 +37,35 @@ def test_cli_server_boot(qcfractal_base_init):
args = ["qcfractal-server", "start", qcfractal_base_init, port]
assert testing.run_process(args, interupt_after=10, **_options)
+
@testing.mark_slow
def test_cli_upgrade(qcfractal_base_init):
args = ["qcfractal-server", "upgrade", qcfractal_base_init]
assert testing.run_process(args, interupt_after=10, **_options)
+
+@testing.mark_slow
+def test_cli_user_add(qcfractal_base_init):
+ args = ["qcfractal-server", "user", qcfractal_base_init, "add", "test_user_add_1", "--permissions", "admin"]
+ assert testing.run_process(args, **_options)
+
+ args = ["qcfractal-server", "user", qcfractal_base_init, "add", "test_user_add_1", "--permissions", "admin"]
+ assert testing.run_process(args, **_options) is False
+
+ args = ["qcfractal-server", "user", qcfractal_base_init, "add", "test_user_add_2", "--password", "foo",
+ "--permissions", "admin"]
+ assert testing.run_process(args, **_options)
+
+ args = ["qcfractal-server", "user", qcfractal_base_init, "add", "test_user_add_3"]
+ assert testing.run_process(args, **_options) is False
+
+
@testing.mark_slow
def test_cli_user_show(qcfractal_base_init):
- args = ["qcfractal-server", "user", qcfractal_base_init, "add", "qcf", "--permissions", "admin"]
+ args = ["qcfractal-server", "user", qcfractal_base_init, "add", "test_user_show", "--permissions", "admin"]
assert testing.run_process(args, **_options)
- args = ["qcfractal-server", "user", qcfractal_base_init, "show", "qcf"]
+ args = ["qcfractal-server", "user", qcfractal_base_init, "show", "test_user_show"]
assert testing.run_process(args, **_options)
args = ["qcfractal-server", "user", qcfractal_base_init, "show", "badname_1234"]
@@ -72,6 +90,7 @@ def active_server(request, qcfractal_base_init):
server.test_uri_cli = "--fractal-uri=localhost:" + port
yield server
+
@testing.mark_slow
@pytest.mark.parametrize("log_apis", [0, 1])
def test_with_api_logging(postgres_server, log_apis):
@@ -90,6 +109,7 @@ def test_with_api_logging(postgres_server, log_apis):
args = ["qcfractal-server", "start", f"--base-folder={tmpdir.name}", port]
assert testing.run_process(args, interupt_after=10, **_options)
+
@testing.mark_slow
def test_manager_local_testing_process():
assert testing.run_process(["qcfractal-manager", "--adapter=pool", "--test", "--tasks-per-worker=2"], **_options)
