barunsaha commited on
Commit
af2d08f
·
1 Parent(s): 8f5ac4a

Update tests for icon embeddings

Browse files
tests/unit/test_icons_embeddings.py CHANGED
@@ -5,7 +5,7 @@ import importlib
5
  import sys
6
  from pathlib import Path
7
  from types import SimpleNamespace
8
- from typing import Any, List
9
 
10
  import numpy as np
11
 
@@ -176,7 +176,7 @@ def test_find_icons(monkeypatch: Any, tmp_path: Path) -> None:
176
  monkeypatch.setattr(mod.GlobalConfig, 'ICONS_FILE_NAME', str(names_file))
177
 
178
  # Make keyword embeddings match each saved one.
179
- def fake_get_embeddings(keywords: List[str]) -> np.ndarray:
180
  out = []
181
  for kw in keywords:
182
  if kw == 'match_a':
@@ -203,7 +203,7 @@ def test_main_calls_and_prints(monkeypatch: Any, capsys: Any) -> None:
203
  called['saved'] = True
204
 
205
 
206
- def fake_find(keywords: List[str]) -> List[str]:
207
  called['found'] = True
208
  return ['x' for _ in keywords]
209
 
 
5
  import sys
6
  from pathlib import Path
7
  from types import SimpleNamespace
8
+ from typing import Any
9
 
10
  import numpy as np
11
 
 
176
  monkeypatch.setattr(mod.GlobalConfig, 'ICONS_FILE_NAME', str(names_file))
177
 
178
  # Make keyword embeddings match each saved one.
179
+ def fake_get_embeddings(keywords: list[str]) -> np.ndarray:
180
  out = []
181
  for kw in keywords:
182
  if kw == 'match_a':
 
203
  called['saved'] = True
204
 
205
 
206
+ def fake_find(keywords: list[str]) -> list[str]:
207
  called['found'] = True
208
  return ['x' for _ in keywords]
209