1import pytest
2import os
3from nomad.api import exceptions
4
5
6# integration tests requires nomad Vagrant VM or Binary running
7@pytest.mark.skipif(tuple(int(i) for i in os.environ.get("NOMAD_VERSION").split(".")) < (0, 5, 5), reason="Not supported in version")
8def test_get_configuration_default(nomad_setup):
9    assert isinstance(nomad_setup.operator.get_configuration(), dict)
10
11
12@pytest.mark.skipif(tuple(int(i) for i in os.environ.get("NOMAD_VERSION").split(".")) < (0, 5, 5), reason="Not supported in version")
13def test_get_configuration_stale(nomad_setup):
14    assert isinstance(nomad_setup.operator.get_configuration(stale=True), dict)
15
16
17@pytest.mark.skipif(tuple(int(i) for i in os.environ.get("NOMAD_VERSION").split(".")) < (0, 5, 5), reason="Not supported in version")
18def test_delete_peer(nomad_setup):
19    with pytest.raises(exceptions.BaseNomadException):
20        nomad_setup.operator.delete_peer("192.168.33.10:4646")
21
22
23def test_dunder_str(nomad_setup):
24    assert isinstance(str(nomad_setup.operator), str)
25
26
27def test_dunder_repr(nomad_setup):
28    assert isinstance(repr(nomad_setup.operator), str)
29
30
31def test_dunder_getattr(nomad_setup):
32    with pytest.raises(AttributeError):
33        d = nomad_setup.operator.does_not_exist
34