File size: 538 Bytes
25fc3a2
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from answer_presenter import AnswerPresenter

def test_answer_presenter():
    answer_presenter = AnswerPresenter()
    
    # Test presenting answer without aggregator
    answer = {"answer": "Test", "aggregator": "NONE"}
    presented_answer = answer_presenter.present(answer)
    assert presented_answer == "Test"
    
    # Test presenting answer with aggregator
    answer = {"answer": "SUM > 1, 2", "cells": ["1", "2"], "aggregator": "SUM"}
    presented_answer = answer_presenter.present(answer)
    assert presented_answer == "3"