Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/roboview/roboview/registries/file_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def register(self, file: FileProperties) -> None:

"""
try:
self._file_registry[file.file_name] = file
self._file_registry[file.path] = file

except Exception:
logger.exception("Failed to register file: %s", file.path)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ def _get_called_keywords_for_file(self, file_path: str) -> list[str]:
"""Get called keywords for a Robot Framework file.

Arguments:
file_path (str): Path of the file to fetch initialized keywords from.
file_path (str): Path of the file to fetch called keywords from.

Returns:
list: List of called keywords for the target file.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,14 @@ def test_register_adds_file_and_len_and_get_all_files_reflect_it():

def test_register_overwrites_existing_same_name():
registry = FileRegistry()
f1 = _make_file("file.robot", "/proj/old.robot")
f2 = _make_file("file.robot", "/proj/new.robot")
f1 = _make_file("file.robot", "/proj/old/")
f2 = _make_file("file.robot", "/proj/new/")

registry.register(f1)
registry.register(f2)

all_files = registry.get_all_files()
assert len(all_files) == 1
assert all_files[0].path == "/proj/new.robot"
assert len(all_files) == 2


def test_resolve_returns_matching_file_by_path():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ export default function FileSelector({
<select
id="resource"
className="filter-select"
value={selectedResource?.file_name || ""}
value={selectedResource?.path || ""}
onChange={(e) => {
const fileName = e.target.value;
if (fileName === "") {
const path = e.target.value;
if (path === "") {
onResourceChange(null);
} else {
const selected = file_list.find((f) => f.file_name === fileName);
const selected = file_list.find((f) => f.path === path);
onResourceChange(selected || null);
}
}}
Expand All @@ -45,7 +45,7 @@ export default function FileSelector({
{resourceFiles.length > 0 && (
<optgroup label="Resource files">
{resourceFiles.map((resource) => (
<option key={resource.path} value={resource.file_name}>
<option key={resource.path} value={resource.path}>
{resource.file_name}
</option>
))}
Expand All @@ -54,7 +54,7 @@ export default function FileSelector({
{robotFiles.length > 0 && (
<optgroup label="Robot files">
{robotFiles.map((resource) => (
<option key={resource.path} value={resource.file_name}>
<option key={resource.path} value={resource.path}>
{resource.file_name}
</option>
))}
Expand Down