Entropy testing and its application to testing Bayesian networks