Пример #1
0
    def test_extra_response_data_from_lax(self):
        "ensure bot-lax handles anything extra that lax may return that would fail validation against the response schema"
        argstr = '--type fs --action ingest+publish --validate-only --target %s' % self.ingest_dir

        # have lax return something bogus
        self.call_lax_resp.update({'pants?': 'party!'})

        with patch('src.adaptor.call_lax', lambda *args, **kwargs: self.call_lax_resp):
            # .write is the 'success' method
            with patch('fs_adaptor.OutgoingQueue.write') as mock: # todo: why doesn't this require a 'src' prefix?
                adapt.main(*argstr.split())
                self.assertTrue(mock.called) # `assert_called` gone missing in 3?
Пример #2
0
    def test_extra_response_data_from_lax(self):
        "ensure bot-lax handles anything extra that lax may return that would fail validation against the response schema"
        argstr = '--type fs --action ingest+publish --validate-only --target %s' % self.ingest_dir

        # have lax return something bogus
        self.call_lax_resp.update({'pants?': 'party!'})

        with patch('src.adaptor.call_lax',
                   lambda *args, **kwargs: self.call_lax_resp):
            # .write is the 'success' method
            with patch(
                    'fs_adaptor.OutgoingQueue.write'
            ) as mock:  # todo: why doesn't this require a 'src' prefix?
                adapt.main(*argstr.split())
                self.assertTrue(
                    mock.called)  # `assert_called` gone missing in 3?
Пример #3
0
 def test_validated_ingest_publish(self):
     "ingest+publish actions handle 'validated' responses"
     argstr = '--type fs --action ingest+publish --validate-only --target %s' % self.ingest_dir
     adapt.main(*argstr.split())
Пример #4
0
 def test_error_ingest_publish(self):
     "ingest+publish actions handle 'error' responses"
     argstr = '--type fs --action ingest+publish --target %s' % self.ingest_dir
     adapt.main(*argstr.split())
Пример #5
0
 def test_validated_ingest_publish(self):
     "ingest+publish actions handle 'validated' responses"
     argstr = '--type fs --action ingest+publish --validate-only --target %s' % self.ingest_dir
     adapt.main(*argstr.split())
Пример #6
0
 def test_error_ingest_publish(self):
     "ingest+publish actions handle 'error' responses"
     argstr = '--type fs --action ingest+publish --target %s' % self.ingest_dir
     adapt.main(*argstr.split())