Exemplo n.º 1
0
def test_get_priority():
    artifact = MockedConnectedArtifactFactory(priority=10)

    future = artifact.start(auto_register=False)
    future.result()
    artifact.mock_presence()

    assert artifact.presence.priority == 10
Exemplo n.º 2
0
def test_get_status_dict():
    artifact = MockedConnectedArtifactFactory(status={"en": "Working"})

    future = artifact.start(auto_register=False)
    future.result()
    artifact.mock_presence()

    assert artifact.presence.status == {"en": "Working"}
Exemplo n.º 3
0
def test_get_state_show():
    artifact = MockedConnectedArtifactFactory(available=True,
                                              show=PresenceShow.AWAY)

    future = artifact.start(auto_register=False)
    future.result()
    artifact.mock_presence()

    assert artifact.presence.state.show == PresenceShow.AWAY
Exemplo n.º 4
0
def test_set_available():
    artifact = MockedConnectedArtifactFactory()

    future = artifact.start(auto_register=False)
    future.result()
    artifact.mock_presence()

    artifact.presence.set_available()
    assert artifact.presence.is_available()
Exemplo n.º 5
0
def test_set_available_with_show():
    artifact = MockedConnectedArtifactFactory()

    future = artifact.start(auto_register=False)
    future.result()
    artifact.mock_presence()

    artifact.presence.set_available(show=PresenceShow.CHAT)
    assert artifact.presence.is_available()
    assert artifact.presence.state.show == PresenceShow.CHAT