'Verify that the command raises an exception when it fails to retrieve
program UUIDs.'

@waffle.testutils.override_switch('populate-multitenant-programs', True)
def test_handle_missing_uuids(self):

    UserFactory(username=self.catalog_integration.service_username)
    with self.assertRaises(SystemExit) as context:
        call_command('cache_programs')
        self.assertEqual(context.exception.code, 1)
    cached_uuids = cache.get(SITE_PROGRAM_UUIDS_CACHE_KEY_TPL.format(domain=self.site_domain))
    self.assertEqual(cached_uuids, [])
