Do
def helper(self, content: str, position: int, expected: int) -> None:
actual = dshctsifi._get_line_number(content, position)
self.assertEqual(actual, expected)
def test1(self) -> None:
"""
Test position in first line returns line 1.
"""
content = "Line 1\nLine 2\nLine 3"
position = 3
expected = 1
self.helper(content, position, expected)
def test2(self) -> None:
"""
Test position in second line returns line 2.
"""
content = "Line 1\nLine 2\nLine 3"
position = 10
expected = 2
self.helper(content, position, expected)