@@ -46,20 +46,18 @@ async def protocol() -> AsyncGenerator[RobotLanguageServerProtocol, None]:
4646
4747@pytest .fixture
4848async def test_document () -> AsyncGenerator [TextDocument , None ]:
49- data = """\
50- ***Test Cases***
51- first
52- Log Hello
53- """
54- yield TextDocument (document_uri = "file:///test.robot" , language_id = "robotframework" , version = 1 , text = data )
49+ data_path = Path (Path (__file__ ).parent , "data/hover.robot" )
50+ data = data_path .read_text ()
51+
52+ yield TextDocument (document_uri = data_path .as_uri (), language_id = "robotframework" , version = 1 , text = data )
5553
5654
5755@pytest .mark .parametrize (
5856 ("position" ,),
5957 [
60- (Position (line = 2 , character = 4 ),),
61- (Position (line = 2 , character = 5 ),),
62- (Position (line = 2 , character = 6 ),),
58+ (Position (line = 9 , character = 4 ),),
59+ (Position (line = 9 , character = 5 ),),
60+ (Position (line = 9 , character = 6 ),),
6361 ],
6462)
6563@pytest .mark .asyncio
@@ -69,17 +67,17 @@ async def test_hover_should_find_simple_keyword(
6967
7068 result = await protocol ._robot_hover .collect (protocol .hover , test_document , position )
7169 assert result
72- assert result .range == Range (start = Position (line = 2 , character = 4 ), end = Position (line = 2 , character = 7 ))
70+ assert result .range == Range (start = Position (line = 9 , character = 4 ), end = Position (line = 9 , character = 7 ))
7371 assert isinstance (result .contents , MarkupContent )
7472 assert result .contents .kind == MarkupKind .MARKDOWN
75- assert "Log" in result .contents .value
73+ assert result .contents .value . startswith ( "#### Log" )
7674
7775
7876@pytest .mark .parametrize (
7977 ("position" ,),
8078 [
81- (Position (line = 2 , character = 3 ),),
82- (Position (line = 2 , character = 7 ),),
79+ (Position (line = 9 , character = 3 ),),
80+ (Position (line = 9 , character = 7 ),),
8381 ],
8482)
8583@pytest .mark .asyncio
0 commit comments