views:

23

answers:

0

Hello,

I am sending commands over suds. I have errors occuring in the command line but I do not know which exceptions to place in as I am not sure which ones to use for SUDS.

try:
    result = self.client.service.GetStreamUri(self.stream, self.token)
    print result
    assert True
except suds.WebFault, e:                        
    assert False

This is to catch a web fault but this test outputs as error as it cannot catch incorrect XML sent over. It says Exception: 400 'Bad Request'. I am not sure how to catch these errors using suds. I put:

except Exception, e:
        assert False

But this does not catch the exception.

Also when I add negative testing and the function accepts input it should not and passes I can not catch the fact that there was not error. So if use:

try:
    result = self.client.service.GetStreamUri(self.stream, self.token)
    print result
    assert False
except suds.WebFault, e:                        
    assert True
except Exception, e:
    assert True

The test claims that incorrect data was caught even though it wasn't. Using exception does not work so I need some suds exceptions to get this to work.

Does anyone know of any other suds exceptions. I have seem a couple in the documentation.

Thanks for any help.