Ejemplo n.º 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?
Ejemplo n.º 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?
Ejemplo n.º 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())
Ejemplo n.º 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())
Ejemplo n.º 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())
Ejemplo n.º 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())