Ejemplo n.º 1
0
def test_team_join_target():
    parsed = team.parse('team join testteam @s')
    parsed: ParsedTeamCommand

    assert isinstance(parsed.target, EntityNode)

    assert str(parsed) == 'team join testteam @s'
Ejemplo n.º 2
0
def test_team_list():
    parsed = team.parse('team list')
    parsed: ParsedTeamCommand

    assert parsed.action.value == 'list'

    assert str(parsed) == 'team list'
Ejemplo n.º 3
0
def test_team_add_displayname():
    parsed = team.parse('team add testteam {"text":"test successful"}')
    parsed: ParsedTeamCommand

    assert parsed.name.object['text'] == 'test successful'

    assert str(parsed) == 'team add testteam {"text":"test successful"}'
Ejemplo n.º 4
0
def test_team_leave():
    parsed = team.parse('team leave @s')
    parsed: ParsedTeamCommand

    assert parsed.action.value == 'leave'
    assert isinstance(parsed.target, EntityNode)

    assert str(parsed) == 'team leave @s'
Ejemplo n.º 5
0
def test_team_add():
    parsed = team.parse('team add testteam')
    parsed: ParsedTeamCommand

    assert parsed.action.value == 'add'
    assert parsed.team.value == 'testteam'

    assert str(parsed) == 'team add testteam'
Ejemplo n.º 6
0
def test_team_join():
    parsed = team.parse('team join testteam')
    parsed: ParsedTeamCommand

    assert parsed.action.value == 'join'
    assert parsed.team.value == 'testteam'

    assert str(parsed) == 'team join testteam'
Ejemplo n.º 7
0
def test_team_empty():
    parsed = team.parse('team empty testteam')
    parsed: ParsedTeamCommand

    assert parsed.action.value == 'empty'
    assert parsed.team.value == 'testteam'

    assert str(parsed) == 'team empty testteam'
Ejemplo n.º 8
0
def test_team_modify():
    parsed = team.parse('team modify testteam displayName '
                        '{"text":"test successful"}')
    parsed: ParsedTeamCommand

    assert parsed.action.value == 'modify'
    assert parsed.team.value == 'testteam'
    assert parsed.option.value == 'displayName'
    assert parsed.value.value == '{"text":"test successful"}'

    assert str(parsed) == 'team modify testteam displayName ' \
                          '{"text":"test successful"}'