def test_is_comment(line, expected): """ Tests if the DataLine class correctly detects comment lines. """ data_line = DataLine(line) assert_equal(data_line.is_comment(), expected)
def test_repr(): """ Tests if the specific repr implementation is sensible. """ data_line = DataLine(" N OBJ") # from the LandS.cor file. assert_equal(repr(data_line), "DataLine(' N OBJ')")
def test_len(length, string): """ Tests if the __len__ function correctly looks at the raw string's length. """ data_line = DataLine(string) assert_equal(len(data_line), length)
def test_str(): """ Tests if the string representation is sensible. """ data_line = DataLine(" N OBJ") # from the LandS.cor file. assert_equal(str(data_line), " N OBJ")
def test_indicator_columns(line, expected): """ The indicator field is the 2-3 column range (inclusive). """ data_line = DataLine(line) assert_equal(data_line.indicator(), expected)