Ejemplo n.º 1
0
def test_write_linegeometry():
    """Test the write_linegeometry() method."""
    from ditto.writers.opendss.write import Writer

    line = setup_line_test()
    output_path = tempfile.gettempdir()
    w = Writer(output_path=output_path)
    w.write_wiredata([line])
    w.write_linegeometry([line])
    with open(os.path.join(output_path, "LineGeometry.dss"), "r") as fp:
        lines = fp.readlines()
    assert get_property_from_dss_string(lines[0], "reduce") == "y"
    assert get_property_from_dss_string(lines[0], "nconds") == "4"
    assert get_property_from_dss_string(lines[0], "nphases") == "3"
    assert get_property_from_dss_string(lines[0], "units") == "m"
    assert get_property_from_dss_string(lines[0], "normamps") == [
        "500.0",
        "500.0",
        "500.0",
        "500.0",
    ]
    assert get_property_from_dss_string(lines[0], "Emergamps") == [
        "1000.0",
        "1000.0",
        "1000.0",
        "1000.0",
    ]
Ejemplo n.º 2
0
def test_write_wiredata():
    """Test the method write_wiredata()."""
    from ditto.writers.opendss.write import Writer

    line = setup_line_test()
    output_path = tempfile.gettempdir()
    w = Writer(output_path=output_path)
    w.write_wiredata([line])