def test_get_segment_allocation_range(self): sa_range = self._create_segment_allocation_range() result = sa_ranges_api.get_segment_allocation_range( self.context, sa_range['id']) expected_result = self._sa_range_to_dict(sa_range, allocations=0) self.assertEqual(expected_result, result)
def test_get_segment_allocation_range_with_allocations(self): sa_range = self._create_segment_allocation_range() allocs = self._allocate_segment(sa_range, count=2) result = sa_ranges_api.get_segment_allocation_range( self.context, sa_range['id']) expected_result = self._sa_range_to_dict(sa_range, allocations=len(allocs)) self.assertEqual(expected_result, result)
def get_segment_allocation_range(self, context, id, fields=None): return segment_allocation_ranges.get_segment_allocation_range( context, id, fields)