Exemplo n.º 1
0
def test_free_terms_are_not_captured():
    from xotl.ql.expressions import any_
    with bubbling() as current:
        next(parent
             for parent in this('parent')
             if parent.name
             if any_(this.children, this.age < 6))
        parts = current.bubble.parts

    assert len(parts) == 2

    pname = this('parent').name
    expected = any_(this.children, this.age < 6)
    with context(UNPROXIFING_CONTEXT):
        assert pname in parts
        assert expected in parts
Exemplo n.º 2
0
 def test_undetected_particles(self):
     from xotl.ql.expressions import any_
     next(parent
           for parent in this('parent')
           if any_(child for child in parent.children if child.age < 6))
     parts = self.bubble.parts
     self.assertIs(0, len(parts))
Exemplo n.º 3
0
    def test_free_terms_are_not_captured(self):
        from xotl.ql.expressions import any_
        these(parent for parent in this('parent') if parent.name
              if any_(this.children, this.age < 6))

        parts = self.bubble.parts
        self.assertIs(0, len(parts))
Exemplo n.º 4
0
    def test_free_terms_are_not_captured(self):
        from xotl.ql.expressions import any_
        these(parent
              for parent in this('parent')
              if parent.name
              if any_(this.children, this.age < 6))

        parts = self.bubble.parts
        self.assertIs(0, len(parts))
Exemplo n.º 5
0
def test_undetected_particles():
    from xotl.ql.expressions import any_
    with bubbling() as current:
        next(parent
             for parent in this('parent')
             if any_(child for child in parent.children if child.age < 6))
        parts = current.bubble.parts

    # `child.age < 6` should not be leaked
    assert 1 == len(parts)
Exemplo n.º 6
0
    def test_free_terms_are_not_captured(self):
        from xotl.ql.expressions import any_
        next(parent for parent in this('parent') if parent.name
             if any_(this.children, this.age < 6))

        parts = self.bubble.parts
        self.assertIs(1, len(parts))
        pname = this('parent').name
        with context(UNPROXIFING_CONTEXT):
            self.assertIn(pname, parts)
Exemplo n.º 7
0
    def test_free_terms_are_not_captured(self):
        from xotl.ql.expressions import any_
        next(parent
              for parent in this('parent')
              if parent.name
              if any_(this.children, this.age < 6))

        parts = self.bubble.parts
        self.assertIs(1, len(parts))
        pname = this('parent').name
        with context(UNPROXIFING_CONTEXT):
            self.assertIn(pname, parts)
Exemplo n.º 8
0
 def test_undetected_particles(self):
     from xotl.ql.expressions import any_
     next(parent for parent in this('parent')
          if any_(child for child in parent.children if child.age < 6))
     parts = self.bubble.parts
     self.assertIs(0, len(parts))