From 77eb4e786762a868058729e5f031ad2fb6c23e59 Mon Sep 17 00:00:00 2001 From: Sajith Sasidharan Date: Mon, 16 Oct 2023 11:39:35 -0500 Subject: [PATCH] Add a test for list_sites(filter_function=..) --- tests/integration/test_fablib.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/integration/test_fablib.py b/tests/integration/test_fablib.py index 59c5a31a..a9e00879 100644 --- a/tests/integration/test_fablib.py +++ b/tests/integration/test_fablib.py @@ -44,6 +44,13 @@ def test_fablib_list_sites_with_fields(self): fablib = FablibManager() fablib.list_sites(fields=["Name", "ConnectX-5 Available", "NVMe Total"]) + def test_fablib_list_sites_with_filter_function(self): + fablib = FablibManager() + fablib.list_sites( + filter_function=lambda s: s["ConnectX-5 Available"] > 3 + and s["NVMe Available"] <= 10 + ) + if __name__ == "__main__": unittest.main()