예제 #1
0
def test_playsound_min_volume():
    parsed = playsound.parse('playsound test:sound master @s 0 0 0 1 1 0.1')
    parsed: ParsedPlaysoundCommand

    assert parsed.minimum_volume.value == 0.1

    assert str(parsed) == 'playsound test:sound master @s 0 0 0 1 1 0.1'
예제 #2
0
def test_playsound_volume():
    parsed = playsound.parse('playsound test:sound master @s 0 0 0 1')
    parsed: ParsedPlaysoundCommand

    assert parsed.volume.value == 1

    assert str(parsed) == 'playsound test:sound master @s 0 0 0 1'
예제 #3
0
def test_playsound_pitch():
    parsed = playsound.parse('playsound test:sound master @s 0 0 0 1 1')
    parsed: ParsedPlaysoundCommand

    assert parsed.pitch.value == 1

    assert str(parsed) == 'playsound test:sound master @s 0 0 0 1 1'
예제 #4
0
def test_playsound_position():
    parsed = playsound.parse('playsound test:sound master @s 0 0 0')
    parsed: ParsedPlaysoundCommand

    assert isinstance(parsed.position, PositionNode)

    assert str(parsed) == 'playsound test:sound master @s 0 0 0'
예제 #5
0
def test_playsound():
    parsed = playsound.parse('playsound test:sound master @s')
    parsed: ParsedPlaysoundCommand

    assert parsed.sound.namespace == 'test'
    assert parsed.sound.name == 'sound'
    assert parsed.source.value == 'master'
    assert isinstance(parsed.target, EntityNode)

    assert str(parsed) == 'playsound test:sound master @s'