def METHOD_NAME(self):
    bad_class_metadata = {
        "module": "some.package",
        "name": "Foo",
    }
    with self.assertRaises(UnsafeData):
        BW2Package._create_class(bad_class_metadata)
    with self.assertRaises(ImportError):
        BW2Package._create_class(bad_class_metadata, False)