def test_ranges_of(self):
        kalibro_ranges_hash = {"kalibro_ranges": [self.subject._asdict()]}

        with patch.object(KalibroRange, 'request', return_value=kalibro_ranges_hash) as request_mock, \
             patch.object(KalibroRange, 'response_to_objects_array', return_value=self.kalibro_ranges) as kalibro_ranges_mock:

            assert_equal(KalibroRange.ranges_of(self.subject.id), self.kalibro_ranges)
            request_mock.assert_called_once_with('', params={"id": self.subject.id}, method='get', prefix="metric_configurations/:id")
            kalibro_ranges_mock.assert_called_once_with(kalibro_ranges_hash)
Пример #2
0
def step_impl(context):
    assert_true(KalibroRange.exists(context.range.id))
Пример #3
0
def step_impl(context):
    context.response = KalibroRange.ranges_of(context.metric_configuration.id)
Пример #4
0
def step_impl(context):
    context.found_range = KalibroRange.find(int(context.range.id))