Select Git revision
test_generic_tree.py

inso authored
commit b3d5d716bcaea5ccb76b013959449f529a9b2b25 Author: inso <insomniak.fr@gmaiL.com> Date: Sat Jan 14 15:58:35 2017 +0100 Use sys.path commit 55e4236a0a194a7ca1f438147eba97ef735f90d2 Author: inso <insomniak.fr@gmaiL.com> Date: Sat Jan 14 15:40:01 2017 +0100 Python path on appveyor commit 3e0ff3cf3ceae00b45a52ed4acf6d4cd9382e20f Author: inso <insomniak.fr@gmaiL.com> Date: Sat Jan 14 15:33:51 2017 +0100 Run tests on appveyor commit 6ec6adfc7ac7ef9bab30d9491cd7b5e94fc3fc7d Author: inso <insomniak.fr@gmaiL.com> Date: Sat Jan 14 10:51:52 2017 +0100 Install dunst on ubuntu commit e6eba8a2ee85d4b5552e8bd50d5617ce25139e8a Author: inso <insomniak.fr@gmaiL.com> Date: Sat Jan 14 10:42:17 2017 +0100 Move tests commit 95fe8829e9c0bfe4ea52e604390c95ffa316c1c5 Author: inso <insomniak.fr@gmaiL.com> Date: Sat Jan 14 10:05:14 2017 +0100 py.test on linux + Qt 5.6 on window commit 8c14f9d5608ab95a0c7abbfc8e3c78d3c98e61f4 Author: inso <insomniak.fr@gmaiL.com> Date: Fri Jan 13 23:41:50 2017 +0100 pytest on linux commit 5243b1af38ccac7b427c328512a3c09a1343a879 Author: inso <insomniak.fr@gmaiL.com> Date: Fri Jan 13 23:38:32 2017 +0100 Fix appveyor commit 5cd764969b15650b82bef24bf123b3f01ce307ee Author: inso <insomniak.fr@gmaiL.com> Date: Fri Jan 13 23:36:20 2017 +0100 Fix ci
test_generic_tree.py 1.68 KiB
from PyQt5.QtCore import QModelIndex
from sakia.models.generic_tree import GenericTreeModel
def test_generic_tree():
data = [
{
'node': {
'title': "Default Profile"
},
'children': [
{
'node': {
'title': "Test net (inso)"
},
'children': [
{
'node': {
'title': "Transactions"
},
'children': []
},
{
'node': {
'title': "Network"
},
'children': []
}
]
},
{
'node': {
'title': "Le sou"
},
'children': [
{
'node': {
'title': "Transactions"
},
'children': {}
},
{
'node': {
'title': "Network"
},
'children': {
}
}
]
}
],
}
]
tree_model = GenericTreeModel.create("Test", data)
assert tree_model.columnCount(QModelIndex()) == 1
assert tree_model.rowCount(QModelIndex()) == 1