<commit_before>#! /usr/bin/env python

from nose.tools import assert_is_instance

from cmt.portprinter.port_printer import PortPrinter
from cmt.testing.ports import UniformRectilinearGridPort
from cmt.testing.assertions import assert_isfile_and_remove


def test_one_printer():
    queue = PortPrinter.from_string("""
[print.air__density]
format=vtk
port=air_port
""")
    assert_is_instance(queue, PortPrinter)

    queue.open()
    queue.write()

    assert_isfile_and_remove('air__density_0000.vtu')


def test_multiple_printers():
    queue = PortPrinter.from_string("""
[print.air__density]
format=vtk
port=air_port

[print.glacier_top_surface__slope]
format=nc
port=earth_port
""")

    assert_is_instance(queue, list)
<commit_msg>Removed unused import statement.<commit_after>#! /usr/bin/env python

from nose.tools import assert_is_instance

from cmt.portprinter.port_printer import PortPrinter
from cmt.testing.assertions import assert_isfile_and_remove


def test_one_printer():
    queue = PortPrinter.from_string("""
[print.air__density]
format=vtk
port=air_port
""")
    assert_is_instance(queue, PortPrinter)

    queue.open()
    queue.write()

    assert_isfile_and_remove('air__density_0000.vtu')


def test_multiple_printers():
    queue = PortPrinter.from_string("""
[print.air__density]
format=vtk
port=air_port

[print.glacier_top_surface__slope]
format=nc
port=earth_port
""")

    assert_is_instance(queue, list)

{'fraction_non_alphanumeric': 0.100974930362117, 'fraction_numerical': 0.005571030640668524, 'mean_word_length': 6.009756097560976, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, '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': '4145767', 'n_tokens_mistral': 520, 'n_tokens_neox': 498, 'n_words': 85}