def test_worksOnSingleLineString(self): src = trimLines(''' foo bah ''') x,y = indexToCoordinates(src,src.index("bah")) self.assertEqual(x,4) self.assertEqual(y,0) x,y = indexToCoordinates(src,src.index("foo")) self.assertEqual(x,0) self.assertEqual(y,0)
def test_worksOnSingleLineString(self): src = trimLines(''' foo bah ''') x, y = indexToCoordinates(src, src.index("bah")) self.assertEqual(x, 4) self.assertEqual(y, 0) x, y = indexToCoordinates(src, src.index("foo")) self.assertEqual(x, 0) self.assertEqual(y, 0)
def test_worksOnMultilLineString(self): src = trimLines(''' foo bah baz boh ''') x,y = indexToCoordinates(src,src.index("boh")) self.assertEqual(x,4) self.assertEqual(y,1)
def test_worksOnMultilLineString(self): src = trimLines(''' foo bah baz boh ''') x, y = indexToCoordinates(src, src.index("boh")) self.assertEqual(x, 4) self.assertEqual(y, 1)