def test_component_initialization(): """Test that component is initialized properly.""" with pytest.raises(ValueError): Component(None) component = Component('test-component') assert component.component_id == 'test-component' assert not component.is_leader
def test_app_add(): """Test adding a components to an App.""" app = AppTest() component = Component('test-component') return_value = app.add(component) assert len(app.components) == 1 assert app.components['test-component'] == component assert return_value == app
def test_component_app_property(): """Test component's app property.""" component = Component('test-component') assert component.app_id is None with pytest.raises(KeyError): assert not component.app app = AppTest() app.add(component) assert component.app == app
def test_component_diagnose(): """Test running diagnostics on component.""" component = Component('test-component') assert component.diagnose() == []
def test_component_disable(): """Test running disable on component.""" component = Component('test-component') assert component.disable() is None
def test_component_setup(): """Test running setup on component.""" component = Component('test-component') assert component.setup(old_version=1) is None