Example #1
0
	def test_missing(self) :
		db = HrtfDatabase('testhrtf/db.hrtfs')
		try :
			db.wavefile(0,91)
			self.fail("An exception was expected")
		except KeyError, e:
			self.assertEqual(e.message, (0,91))
Example #2
0
	def test_cachedFiles_same(self) :
		db = HrtfDatabase('testhrtf/db.hrtfs')
		db.hrtf(0,+90)
		db.hrtf(0,+91)
		self.assertEqual([
			"testhrtf/left.wav",
			], db.cachedFiles())
Example #3
0
	def test_cachedFiles_many(self) :
		db = HrtfDatabase('testhrtf/db.hrtfs')
		db.hrtf(0,+90)
		db.hrtf(0,-90)
		self.assertEqual([
			"testhrtf/left.wav",
			"testhrtf/right.wav",
			], db.cachedFiles())
Example #4
0
	def test_cachedFiles_all(self) :
		db = HrtfDatabase('testhrtf/db.hrtfs')
		db.preload()
		self.assertEqual([
			"testhrtf/left.wav",
			"testhrtf/front.wav",
			"testhrtf/back.wav",
			"testhrtf/right.wav",
			], db.cachedFiles())
Example #5
0
	def test_loadAudio_nearleft(self) :
		db = HrtfDatabase('testhrtf/db.hrtfs')
		np_assert_equal(
			self._audioLeft,
			db.hrtf(0,91))
Example #6
0
	def test_nearestWavefile(self) :
		db = HrtfDatabase('testhrtf/db.hrtfs')
		self.assertEqual(
			'testhrtf/left.wav',
			db.nearestWavefile(0, 91))
Example #7
0
	def test_nearest_near(self) :
		db = HrtfDatabase('testhrtf/db.hrtfs')
		self.assertEqual((0,90), db.nearest(0, 91))
Example #8
0
	def test_existing(self) :
		db = HrtfDatabase('testhrtf/db.hrtfs')
		self.assertEqual('testhrtf/left.wav', db.wavefile(0,90))