Exemplo n.º 1
0
    def test_getFlacPath(self):
        # microphone.FLAC_PATH = None
        # with pytest.raises(MicrophoneError):
        #    _getFlacPath('this is not flac')
        microphone.FLAC_PATH = None
        _getFlacPath()
        microphone.FLAC_PATH = None
        _getFlacPath("flac")

        microphone.FLAC_PATH = "flac"
        assert microphone.FLAC_PATH
Exemplo n.º 2
0
    def test_getFlacPath(self):
        #microphone.FLAC_PATH = None
        #with pytest.raises(MicrophoneError):
        #    _getFlacPath('this is not flac')
        microphone.FLAC_PATH = None
        _getFlacPath()
        microphone.FLAC_PATH = None
        _getFlacPath('flac')

        microphone.FLAC_PATH = 'flac'
        assert microphone.FLAC_PATH
Exemplo n.º 3
0
 def setup_class(self):
     try:
         assert _getFlacPath()
     except:
         pytest.skip()
     self.tmp = mkdtemp(prefix="psychopy-tests-microphone")
     for testFile in ["red_16000.flac.dist", "green_48000.flac.dist"]:
         t = join(TESTS_DATA_PATH, testFile)
         new_wav = join(self.tmp, testFile.replace(".dist", ""))
         shutil.copyfile(t, new_wav)
         flac2wav(new_wav)
Exemplo n.º 4
0
 def setup_class(self):
     try:
         assert _getFlacPath()
     except:
         pytest.skip()
     self.tmp = mkdtemp(prefix='psychopy-tests-microphone')
     for testFile in ['red_16000.flac.dist', 'green_48000.flac.dist']:
         t = join(TESTS_DATA_PATH, testFile)
         new_wav = join(self.tmp, testFile.replace('.dist', ''))
         shutil.copyfile(t, new_wav)
         flac2wav(new_wav)
Exemplo n.º 5
0
 def setup_class(self):
     try:
         assert _getFlacPath()
     except Exception:
         # some of the utils could be designed not to need flac but they
         # currently work on a file that is distributed in flac format
         pytest.skip()
     self.tmp = mkdtemp(prefix='psychopy-tests-microphone')
     for testFile in ['red_16000.flac.dist', 'green_48000.flac.dist']:
         t = join(TESTS_DATA_PATH, testFile)
         new_wav = join(self.tmp, testFile.replace('.dist', ''))
         shutil.copyfile(t, new_wav)
         microphone.flac2wav(new_wav)
Exemplo n.º 6
0
 def setup_class(self):
     try:
         assert _getFlacPath()
     except Exception:
         # some of the utils could be designed not to need flac but they
         # currently work on a file that is distributed in flac format
         pytest.skip()
     self.tmp = mkdtemp(prefix='psychopy-tests-microphone')
     for testFile in ['red_16000.flac.dist', 'green_48000.flac.dist']:
         t = join(TESTS_DATA_PATH, testFile)
         new_wav = join(self.tmp, testFile.replace('.dist', ''))
         shutil.copyfile(t, new_wav)
         flac2wav(new_wav)
Exemplo n.º 7
0
    def test_getFlacPath(self):
        microphone.FLAC_PATH = None
        with pytest.raises(microphone.MicrophoneError):
            _getFlacPath('this is not the flac you are looking for')

        microphone.FLAC_PATH = None
        _getFlacPath('flac')

        microphone.FLAC_PATH = 'flac'
        assert microphone.FLAC_PATH

        microphone.FLAC_PATH = None
        _getFlacPath()
Exemplo n.º 8
0
    def test_getFlacPath(self):
        microphone.FLAC_PATH = None
        with pytest.raises(MicrophoneError):
            _getFlacPath('this is not the flac you are looking for')

        microphone.FLAC_PATH = None
        _getFlacPath('flac')

        microphone.FLAC_PATH = 'flac'
        assert microphone.FLAC_PATH

        microphone.FLAC_PATH = None
        _getFlacPath()