Improve a test for ref #1643, and make sure that unexpected URIs actually raise AssertionError.

Signed-off-by: Daira Hopwood <david-sarah@jacaranda.org>