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)
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