def test_contains(self):
    tree = DomainTree(domains=self.d0, min_split=0.5)
    x = {'x0': 0}
    self.assertTrue(tree.contains(x))
    x = {'x0': 1}
    self.assertFalse(tree.contains(x))
    x = {'x0': 0.5}
    self.assertTrue(tree.contains(x))
    d = RealDomain({'x0': RealInterval((0, 1), (True, False)), 'x1': RealInterval((2, 3), (True, False))})
    tree = DomainTree(domains=d, min_split=0.5)
    x = {'x0': 0, 'x1': 2}
    self.assertTrue(tree.contains(x))
    x = {'x0': 1, 'x1': 2}
    self.assertFalse(tree.contains(x))
    x = {'x0': 0.5, 'x1': 2.99}
    self.assertTrue(tree.contains(x))
    d = RealDomain({'x0': RealInterval((0, 1), (True, True)), 'x1': RealInterval((2, 3), (False, False))})
    tree = DomainTree(domains=d, min_split=0.5)
    x = {'x0': 0, 'x1': 2}
    self.assertFalse(tree.contains(x))
    x = {'x0': 0, 'x1': 2.5}
    self.assertTrue(tree.contains(x))
def test_contains(self):
    tree = DomainTree(domains=self.d0, min_split=0.5)
    x = {'x0': 0}
    self.assertTrue(tree.contains(x))
    x = {'x0': 1}
    self.assertFalse(tree.contains(x))
    x = {'x0': 0.5}
    self.assertTrue(tree.contains(x))
    d = RealDomain({'x0': RealInterval((0, 1), (True, False)), 'x1': RealInterval((2, 3), (True, False))})
    tree = DomainTree(domains=d, min_split=0.5)
    x = {'x0': 0, 'x1': 2}
    self.assertTrue(tree.contains(x))
    x = {'x0': 1, 'x1': 2}
    self.assertFalse(tree.contains(x))
    x = {'x0': 0.5, 'x1': 2.99}
    self.assertTrue(tree.contains(x))
    d = RealDomain({'x0': RealInterval((0, 1), (True, True)), 'x1': RealInterval((2, 3), (False, False))})
    tree = DomainTree(domains=d, min_split=0.5)
    x = {'x0': 0, 'x1': 2}
    self.assertFalse(tree.contains(x))
    x = {'x0': 0, 'x1': 2.5}
    self.assertTrue(tree.contains(x))