TESTS: Add a common mock_be_ctx function Reduces code duplication between tests. Reviewed-by: Sumit Bose <sbose@redhat.com>