def test_print_situation_mentions_with_properties(capsys, num_properties): num_properties = 3 print_situation_mentions(_comm_with_properties(num_properties)) (out, err) = capsys.readouterr() assert 1 == out.count("Properties") assert 1 == out.count("Annotator1") assert num_properties == out.count("Property") assert num_properties == out.count("4.0")
def test_print_situation_mentions(capsys): comm = _comm_with_properties(0) print_situation_mentions(comm) (out, err) = capsys.readouterr() assert err == '' assert re.search(r'SituationMention\s+(\d+)-(\d+):\n', out) assert not re.search(r'situationType:', out) assert not re.search(r'situationKind:', out) assert not re.search(r'intensity:', out)
def test_print_situation_mentions_with_intensity(capsys): comm = _comm_with_properties(0) comm.situationMentionSetList[0].mentionList[0].intensity = 3.5 print_situation_mentions(comm) (out, err) = capsys.readouterr() assert err == '' assert re.search( r'SituationMention +(\d+)-(\d+):\n +intensity: +3\.50*\n', out) assert not re.search(r'situationType:', out) assert not re.search(r'situationKind:', out)
def test_print_situation_mentions_with_kind(capsys): comm = _comm_with_properties(0) comm.situationMentionSetList[0].mentionList[0].situationKind = u'sk' print_situation_mentions(comm) (out, err) = capsys.readouterr() assert err == '' assert re.search( r'SituationMention +(\d+)-(\d+):\n +situationKind: +sk\n', out) assert not re.search(r'situationType:', out) assert not re.search(r'intensity:', out)
def test_print_situation_mentions_with_intensity(capsys): comm = _comm_with_properties(0) comm.situationMentionSetList[0].mentionList[0].intensity = 3.5 print_situation_mentions(comm) (out, err) = capsys.readouterr() assert err == '' assert re.search(r'SituationMention +(\d+)-(\d+):\n +intensity: +3\.50*\n', out) assert not re.search(r'situationType:', out) assert not re.search(r'situationKind:', out)
def test_print_situation_mentions_with_kind(capsys): comm = _comm_with_properties(0) comm.situationMentionSetList[0].mentionList[0].situationKind = u'sk' print_situation_mentions(comm) (out, err) = capsys.readouterr() assert err == '' assert re.search(r'SituationMention +(\d+)-(\d+):\n +situationKind: +sk\n', out) assert not re.search(r'situationType:', out) assert not re.search(r'intensity:', out)
def test_print_situation_mentions_without_properties(capsys): print_situation_mentions(_comm_with_properties(0)) (out, err) = capsys.readouterr() assert 'Properties' not in out