Exemplo n.º 1
0
    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)
Exemplo n.º 2
0
    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)
Exemplo n.º 3
0
 def get_segment_allocation_range(self, context, id, fields=None):
     return segment_allocation_ranges.get_segment_allocation_range(
         context, id, fields)