36 lines
No EOL
1.2 KiB
Python
36 lines
No EOL
1.2 KiB
Python
# -*- coding: utf-8 -*-
|
|
"""Unit tests: hybrid evidence classification matrix."""
|
|
from src.hybrid import classify
|
|
from src.forecasting.record import HybridState
|
|
|
|
|
|
def test_case1_agreement_bullish():
|
|
assert classify("bullish", "bullish") == HybridState.STRONG_AGREEMENT
|
|
|
|
|
|
def test_case1_agreement_bearish():
|
|
assert classify("bearish", "bearish") == HybridState.STRONG_AGREEMENT
|
|
|
|
|
|
def test_case2_disagreement():
|
|
assert classify("bullish", "bearish") == HybridState.DISAGREEMENT
|
|
assert classify("bearish", "bullish") == HybridState.DISAGREEMENT
|
|
|
|
|
|
def test_case3_partial_evidence():
|
|
assert classify("bullish", "neutral") == HybridState.PARTIAL_EVIDENCE
|
|
assert classify("neutral", "bearish") == HybridState.PARTIAL_EVIDENCE
|
|
assert classify("bullish", "no_edge") == HybridState.PARTIAL_EVIDENCE
|
|
|
|
|
|
def test_case4_no_evidence():
|
|
assert classify("neutral", "neutral") == HybridState.NO_EDGE
|
|
assert classify("no_edge", "neutral") == HybridState.NO_EDGE
|
|
|
|
|
|
def test_insufficient_both():
|
|
assert classify("insufficient", "insufficient") == HybridState.INSUFFICIENT_EVIDENCE
|
|
|
|
|
|
def test_case_insensitivity_case():
|
|
assert classify("BULLISH", "Bullish") == HybridState.STRONG_AGREEMENT |