def METHOD_NAME(self, arch, expected_features):
    machinetype.cpu_features.invalidate()
    conn = FakeConnection(arch)
    with MonkeyPatchScope([
            (machinetype.cpuarch, 'real', lambda: arch),
            (machinetype.libvirtconnection, 'get', lambda: conn), ]):
        result = machinetype.cpu_features()
        self.assertEqual(result, expected_features)