Fixed wrong use of testtools.ExpectedException

Change-Id: Ifc4b2a7c52346fd5fb6d9d023236a13afd0f30ec
Merge "Fixed wrong use of testtools.ExpectedException"