Spaces:
Sleeping
Sleeping
File size: 892 Bytes
07e5a95 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | 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()
|