def test_named(): """Tests named HFOS base components""" a = pytest.TestComponent(uniquename="BERTRAM") pytest.clean_test_components() assert a.uniquename == "BERTRAM"
def test_config_uuid(): """Tests if ConfigurableComponents configurations get an UUID assigned""" c = pytest.TestComponent() pytest.clean_test_components() assert type(c.config.uuid) == str
def test_uniquename(): """Tests uniquename functionality of HFOS base components""" a = pytest.TestComponent() b = pytest.TestComponent() pytest.clean_test_components() assert a.uniquename != b.uniquename
def test_configschema(): """Tests if ConfigurableComponents obtain a configuration schema""" c = pytest.TestComponent() pytest.clean_test_components() assert type(c.configschema) == dict assert 'schema' in c.configschema assert 'properties' in c.configschema['schema']
def test_configschema(): """Tests if ConfigurableComponents obtain a configuration schema""" c = pytest.TestComponent("FOO") pytest.clean_test_components() assert type(c.configschema) == dict assert "schema" in c.configschema assert "properties" in c.configschema["schema"]
def test_uniquename(): """Tests uniquename functionality of Isomer base components""" a = pytest.TestComponent("FOO") b = pytest.TestComponent("FOO") pytest.clean_test_components() assert a.uniquename != b.uniquename assert a.uniquename in pytest.TestComponent.names
def test_maintenance_log(): log = logger.LiveLog logger.live = True maint = Maintenance() maint.register(m) pytest.clean_test_components() assert "Performing maintenance check" in str(log)
def test_unique_warning(): log = logger.LiveLog logger.live = True c = pytest.TestComponent(uniquename='FOO') d = pytest.TestComponent(uniquename='FOO') pytest.clean_test_components() assert "Unique component added twice: " in str(log)
def test_write_none_config(): log = logger.LiveLog logger.live = True c = pytest.TestComponent() c.config = None c._write_config() pytest.clean_test_components() assert "Unable to write non existing configuration" in str(log)
def test_unique_warning(): """Test for uniqueness of generated components""" log = logger.LiveLog logger.live = True c = pytest.TestComponent("FOO") d = pytest.TestComponent("FOO") pytest.clean_test_components() assert "Unique component added twice: " in str(log)
def test_component_log(): """Tests if a component logs correctly""" c = pytest.TestComponent() unique = str(uuid4()) log = logger.LiveLog logger.live = True c.log(unique) pytest.clean_test_components() assert unique in str(log)