2015-03-03 13:41:00 +03:00
|
|
|
from __future__ import unicode_literals
|
2015-07-23 10:26:43 +03:00
|
|
|
import pytest
|
2015-03-03 13:41:00 +03:00
|
|
|
|
|
|
|
|
2015-07-23 10:26:43 +03:00
|
|
|
@pytest.mark.models
|
2015-06-07 19:02:24 +03:00
|
|
|
def test_subtrees(EN):
|
2015-03-03 13:41:00 +03:00
|
|
|
sent = EN('The four wheels on the bus turned quickly')
|
|
|
|
wheels = sent[2]
|
|
|
|
bus = sent[5]
|
|
|
|
assert len(list(wheels.lefts)) == 2
|
|
|
|
assert len(list(wheels.rights)) == 1
|
|
|
|
assert len(list(wheels.children)) == 3
|
|
|
|
assert len(list(bus.lefts)) == 1
|
|
|
|
assert len(list(bus.rights)) == 0
|
|
|
|
assert len(list(bus.children)) == 1
|
|
|
|
|
|
|
|
assert len(list(wheels.subtree)) == 6
|