Testing properties of trees in graphical models with covariance queries