Skip to content

Commit

Permalink
Add filesystem tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Zedeldi committed Oct 18, 2024
1 parent 23dc84d commit 9af5ca6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion igelfs/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def get_info(self, lxos_config: LXOSParser | None = None) -> dict[str, Any]:
"path": self.path.as_posix(),
"size": self.size,
"section_count": self.section_count,
"partition_minors": sorted(self.partition_minors),
"partition_minors": sorted(self.partition_minors_by_directory),
}
if lxos_config:
info["partition_names"] = [
Expand Down
11 changes: 11 additions & 0 deletions igelfs/tests/test_filesystem.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
"""Unit tests for the filesystem class."""

import pytest

from igelfs import Filesystem


@pytest.mark.slow
def test_filesystem_partition_minors(filesystem: Filesystem) -> None:
"""Test getting partition minors from filesystem."""
assert filesystem.partition_minors == filesystem.partition_minors_by_directory
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,6 @@ warn_unused_ignores = true

[tool.pytest.ini_options]
markers = [
"inf: tests require LXOS configuration file"
"inf: tests require LXOS configuration file",
"slow: tests take a while to complete",
]

0 comments on commit 9af5ca6

Please sign in to comment.