예제 #1
0
def test_ConversationWidget_init_right():
    """
    Check the ConversationWidget is configured correctly for align-left.
    """
    cw = ConversationWidget('hello', align='right')
    layout = cw.layout()
    assert isinstance(layout.takeAt(0), QSpacerItem)
    assert isinstance(layout.takeAt(0), QWidgetItem)
예제 #2
0
def test_ConversationWidget_init_right(mocker):
    """
    Check the ConversationWidget is configured correctly for align-left.
    """
    mock_signal = mocker.Mock()
    mock_connect = mocker.Mock()
    mock_signal.connect = mock_connect

    cw = ConversationWidget('mock id', 'hello', mock_signal, align='right')
    layout = cw.layout()

    assert isinstance(layout.takeAt(0), QSpacerItem)
    assert isinstance(layout.takeAt(0), QWidgetItem)
    assert mock_connect.called