<commit_before>import fixtures

import dnfile


def test_duplicate_stream():
    path = fixtures.DATA / "invalid-streams" / "duplicate-stream.exe"

    dn = dnfile.dnPE(path)

    assert "#US" in dn.net.metadata.streams
    assert dn.net.user_strings.get_us(1).value == "BBBBBBBB"<commit_msg>tests: add test demonstrating handling of unknown stream<commit_after>import fixtures

import dnfile


def test_duplicate_stream():
    path = fixtures.DATA / "invalid-streams" / "duplicate-stream.exe"

    dn = dnfile.dnPE(path)

    assert "#US" in dn.net.metadata.streams
    assert dn.net.user_strings.get_us(1).value == "BBBBBBBB"


def test_unknown_stream():
    path = fixtures.DATA / "invalid-streams" / "unknown-stream.exe"

    dn = dnfile.dnPE(path)

    assert "#ZZ" in dn.net.metadata.streams
{'fraction_non_alphanumeric': 0.12421580928481807, 'fraction_numerical': 0.002509410288582183, 'mean_word_length': 3.8072289156626504, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6789648', 'n_tokens_mistral': 298, 'n_tokens_neox': 276, 'n_words': 56}