예제 #1
0
def test_is_blank_no_control():
    """
    Test the is_blank() method when there's no control
    """
    # GIVEN: A LibreOfficeServer instance and a bunch of mocks
    server = LibreOfficeServer()

    # WHEN: is_blank() is called
    result = server.is_blank()

    # THEN: It should have returned False
    assert result is False
예제 #2
0
def test_is_blank_control_is_running():
    """
    Test the is_blank() method when the control is running
    """
    # GIVEN: A LibreOfficeServer instance and a bunch of mocks
    server = LibreOfficeServer()
    mocked_control = MagicMock()
    server._control = mocked_control
    mocked_control.isRunning.return_value = True
    mocked_control.isPaused.return_value = True

    # WHEN: is_blank() is called
    result = server.is_blank()

    # THEN: It should have returned False
    assert result is True
    mocked_control.isRunning.assert_called_once_with()
    mocked_control.isPaused.assert_called_once_with()