kopia lustrzana https://gitlab.com/zeograd/rnsutils
Support python2.7 in instrument loading
rodzic
42048f3360
commit
30e5973494
|
@ -43,7 +43,7 @@ class RenoiseInstrument(object):
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
self.load(template_filename)
|
self.load(template_filename)
|
||||||
except FileNotFoundError:
|
except IOError:
|
||||||
self.load(io.BytesIO(pkgutil.get_data('rnsutils', 'data/{}'.format(template_filename))))
|
self.load(io.BytesIO(pkgutil.get_data('rnsutils', 'data/{}'.format(template_filename))))
|
||||||
|
|
||||||
self.extract_sample_template()
|
self.extract_sample_template()
|
||||||
|
|
|
@ -1,6 +1,13 @@
|
||||||
|
import unittest
|
||||||
|
|
||||||
from rnsutils.instrument import RenoiseInstrument
|
from rnsutils.instrument import RenoiseInstrument
|
||||||
|
|
||||||
|
|
||||||
def test_open_template():
|
class TestParse(unittest.TestCase):
|
||||||
# creates an empty instrument, which trigger template loading
|
def test_open_template(self):
|
||||||
RenoiseInstrument()
|
# creates an empty instrument, which trigger template loading
|
||||||
|
RenoiseInstrument()
|
||||||
|
|
||||||
|
def test_missing_template(self):
|
||||||
|
with self.assertRaises(Exception):
|
||||||
|
RenoiseInstrument(template_filename='I dont exist.xnri')
|
||||||
|
|
Ładowanie…
Reference in New Issue