Add expectException utility method

Makes the test code a bit cleaner, and makes it easier to add more
tests.

Test: atest sdkextensions_e2e_test
Change-Id: Iec05b026b6aa16b6ffa4579a3988390c9c9cf02f
1 file changed