We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f449717 commit 4745282Copy full SHA for 4745282
pylabrobot/resources/carrier.py
@@ -52,6 +52,10 @@ def capacity(self):
52
"""The number of sites on this carrier."""
53
return len(self.sites)
54
55
+ def __len__(self) -> int:
56
+ """Return the number of sites on this carrier."""
57
+ return len(self.sites)
58
+
59
def assign_child_resource(
60
self,
61
resource: Resource,
pylabrobot/resources/carrier_tests.py
@@ -160,6 +160,9 @@ def test_absolute_location(self):
160
def test_capacity(self):
161
self.assertEqual(self.tip_car.capacity, 5)
162
163
+ def test_len(self):
164
+ self.assertEqual(len(self.tip_car), 5)
165
166
def test_assignment(self):
167
self.tip_car[0] = self.A
168
self.tip_car[1] = self.B
0 commit comments