Standardises expected exception layout

Standardises how we handle expected exceptions to use
assertRaise rather than using try/except/else

Fixes bug 1132577

Change-Id: Idfefe4c9337e9b832d34a490da21ac32ec65edd1
14 files changed