Fixing some small mistakes made in 9de664a (#86)

This commit is contained in:
Ngô Ngọc Đức Huy 2020-04-26 09:49:30 +07:00 committed by GitHub
parent 9de664a750
commit b2329a1428
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 9 deletions

View File

@ -76,7 +76,7 @@ __all__ = [
'thread_local', 'current_context', 'use_context',
'cache', 'free', 'decode', 'sample_size', 'sample_length',
'Device', 'Context', 'Listener', 'Buffer', 'Source', 'SourceGroup',
'Effect', 'ReverbEffect', 'ChorusEffect',
'BaseEffect', 'ReverbEffect', 'ChorusEffect',
'Decoder', 'BaseDecoder', 'FileIO', 'MessageHandler']
from abc import abstractmethod, ABCMeta
@ -2010,7 +2010,7 @@ cdef class BaseEffect:
return <boolean> self.slot and <boolean> self.impl
@setter
def gain(self, value: float) -> None:
def slot_gain(self, value: float) -> None:
"""Gain of the effect slot."""
self.slot.set_gain(value)

View File

@ -23,14 +23,14 @@ from palace import BaseEffect, ReverbEffect, Source
from pytest import raises
def test_gain(context):
"""Test write-only property gain."""
def test_slot_gain(context):
"""Test write-only property slot_gain."""
with BaseEffect() as fx:
fx.gain = 0
fx.gain = 1
fx.gain = 5/7
with raises(ValueError): fx.gain = 7/5
with raises(ValueError): fx.gain = -1
fx.slot_gain = 0
fx.slot_gain = 1
fx.slot_gain = 5/7
with raises(ValueError): fx.slot_gain = 7/5
with raises(ValueError): fx.slot_gain = -1
def test_source_sends(context):