示例#1
0
 def test_confirm_is_annotated(self, sample_mock):
     sample_mock.configure_mock(endpoint='sample',
                                id=42,
                                api=MagicMock(),
                                logger=MagicMock())
     Sample.confirm_is_annotated(sample_mock)
     sample_mock.api(42).patch.assert_called_once_with(
         {'descriptor_completed': True})
示例#2
0
    def test_confirm_is_annotated(self, sample_mock):
        sample_mock.configure_mock(endpoint='anything but presample')
        with self.assertRaises(NotImplementedError):
            Sample.confirm_is_annotated(sample_mock)

        sample_mock.configure_mock(endpoint='presample', id=42,
                                   api=MagicMock(), logger=MagicMock())
        Sample.confirm_is_annotated(sample_mock)
        sample_mock.api(42).patch.assert_called_once_with({'presample': False})
示例#3
0
 def test_confirm_is_annotated(self, sample_mock):
     sample_mock.configure_mock(endpoint='sample', id=42, api=MagicMock(), logger=MagicMock())
     Sample.confirm_is_annotated(sample_mock)
     sample_mock.api(42).patch.assert_called_once_with({'descriptor_completed': True})