DesenrolaAi / python-basic-pitch /tests /test_shadow_benchmark.py
Azure DevOps Pipeline
deploy: Merged PR 29: melhoria no projeto, refatoracao e desempenho para 100 pessoas logadas
07e5a95
Raw
History Blame Contribute Delete
892 Bytes
import sys
import unittest
from pathlib import Path
sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
from shadow_benchmark import compare_shadow_outputs
from temporal_chord_metrics import ChordInterval
class ShadowBenchmarkTests(unittest.TestCase):
def test_ranqueia_provider_sem_promover_runtime(self):
reference = [ChordInterval(0, 1, "C"), ChordInterval(1, 2, "G")]
result = compare_shadow_outputs(
reference,
{
"current": [ChordInterval(0, 2, "C")],
"candidate": [ChordInterval(0, 1, "C"), ChordInterval(1, 2, "G")],
},
)
self.assertEqual(result["winner"], "candidate")
self.assertEqual(result["ranking"], ["candidate", "current"])
self.assertEqual(result["providers"]["candidate"]["exact_wcsr"], 1.0)
if __name__ == "__main__":
unittest.main()