text: #!/usr/bin/env python
  # -*- encoding: utf-8 -*-
  '''Analyzer'''
  
  import pytest
  
  import librosa
  import crema.analyze
  
  
  @pytest.fixture
  def SIGNAL():
      y, sr = librosa.load(librosa.util.example_audio_file(),
                           sr=None)
      return y, sr
  
  
  @pytest.fixture
  def AUDIOFILE():
      return librosa.util.example_audio_file()
  
  
  
  def _validate_analysis(jam):
  
      assert jam.annotations['chord']
      jam.validate()
  
  
  def test_analyze_signal(SIGNAL):
      y, sr = SIGNAL
      jam = crema.analyze.analyze(y=y, sr=sr)
      _validate_analysis(jam)
  
  
  def test_analyze_filename(AUDIOFILE):
      jam = crema.analyze.analyze(filename=AUDIOFILE)
      _validate_analysis(jam)
  