Skip to content

Commit 6653e10

Browse files
committed
test: add get_scales coverage test for Fabric path
Exercises the Fabric-native get_scales() path. Coverage of fabric_frame_view.py: 76% → 83%.
1 parent 9245d11 commit 6653e10

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

source/isaaclab_physx/test/sim/test_views_xform_prim_fabric.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,3 +199,19 @@ def test_prepare_for_reuse_detects_topology_change(device, view_factory):
199199
result = view._fabric_selection.PrepareForReuse()
200200
assert isinstance(result, bool), f"PrepareForReuse should return bool, got {type(result)}"
201201
assert not result, "PrepareForReuse should return False when no topology change"
202+
203+
204+
@pytest.mark.parametrize("device", ["cuda:0"])
205+
def test_get_scales_fabric_path(device, view_factory):
206+
"""Exercise the Fabric-native get_scales path."""
207+
bundle = view_factory(num_envs=1, device=device)
208+
view = bundle.view
209+
210+
# Trigger Fabric init
211+
view.get_world_poses()
212+
213+
scales = view.get_scales()
214+
scales_t = wp.to_torch(scales)
215+
# Default scale should be (1, 1, 1)
216+
expected = torch.tensor([[1.0, 1.0, 1.0]], dtype=torch.float32, device=device)
217+
torch.testing.assert_close(scales_t, expected, atol=1e-4, rtol=0)

0 commit comments

Comments
 (0)