Example #1
0
def test_info_clients_validation():
    """Test clients parameter validation during initialization."""
    with pytest.raises(AssertionError):
        Info('test-app', 3, clients='invalid')

    clients = [{
        'name': 'test',
        'platforms': [{
            'type': 'web',
            'url': 'test-url'
        }]
    }]
    Info('test-app', 3, clients=clients)
Example #2
0
def test_info_initialization_with_args():
    """Test initializing the Info component with arguments."""
    clients = [{
        'name': 'test',
        'platforms': [{
            'type': 'web',
            'url': 'test-url'
        }]
    }]
    info = Info('test-app',
                3,
                is_essential=True,
                depends=['test-app-2'],
                name='Test App',
                icon='fa-test',
                icon_filename='test-icon',
                short_description='For Test',
                description='Test description',
                manual_page='Test',
                clients=clients)
    assert info.is_essential
    assert info.depends == ['test-app-2']
    assert info.name == 'Test App'
    assert info.icon == 'fa-test'
    assert info.icon_filename == 'test-icon'
    assert info.short_description == 'For Test'
    assert info.description == 'Test description'
    assert info.manual_page == 'Test'
    assert info.clients == clients
Example #3
0
def test_info_initialization_without_args():
    """Test initializing the Info component without arguments."""
    info = Info('test-app', 3)
    assert info.component_id == 'test-app-info'
    assert info.app_id == 'test-app'
    assert info.version == 3
    assert not info.is_essential
    assert info.depends == []
    assert info.name is None
    assert info.icon is None
    assert info.icon_filename is None
    assert info.short_description is None
    assert info.description is None
    assert info.manual_page is None
    assert info.clients is None
Example #4
0
 def __init__(self):
     super().__init__()
     self.add(Info('app3', version=1))
Example #5
0
 def __init__(self):
     super().__init__()
     self.add(Info('app2', version=1, depends=['app1']))
Example #6
0
 def __init__(self):
     super().__init__()
     self.add(Info('app2', version=1, is_essential=True))
Example #7
0
 def __init__(self):
     super().__init__()
     info = Info('test-app-setup', 3)
     self.add(info)