def test_gets_leaves_and_filterbyname(self): tmf = models.TreeModelFactory('tests/fixtures/filterbyname') tree = tmf.getInstance() result = tree.filterBy("name", "ciccio").getLeaves() print(result) assert result == [{"prop": "value4"}, {"prop": "value5"}]
def test_gets_leaves_on_oneleveltree(self): tmf = models.TreeModelFactory('tests/fixtures/oneleveltree') tree = tmf.getInstance() result = tree.getLeaves() assert result == [{"prop": "value1"}, {"prop": "value2"}]
def test_gets_leaf_on_zerolevel(self): tmf = models.TreeModelFactory('tests/fixtures/zerolevelthree') tree = tmf.getInstance() result = tree.getLeaves() assert result == [{'prop': "value"}]
def txest_gets_leaves_on_threeleveletc(self): tmf = models.TreeModelFactory('tests/fixtures/threelevelbalancedfigli') tree = tmf.getInstance() result = tree.navigateBy("figli").getLeaves() assert result == [{ "prop": "value4" }, { "prop": "value5" }, { "prop": "value6" }]
def __init__(self, dataSource, navigateKey, filterKey): self.__treeModel = models.TreeModelFactory(dataSource).getInstance() self.__navigateKey = navigateKey self.__filterKey = filterKey
def test_creates_a_treeModel(self): tmf = models.TreeModelFactory('tests/fixtures/some') treeModel = tmf.getInstance() assert treeModel is not None
def test_gets_leaves_on_twolevelunbalanced(self): tmf = models.TreeModelFactory('tests/fixtures/twolevelunbalanced') tree = tmf.getInstance() result = tree.getLeaves() assert result == [{"prop": "value1"}, {"prop": "value3"}]