Esempio 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
Esempio 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"}
Esempio 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
Esempio 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()
Esempio 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