controllers: add a controller for the stash gui
[git-cola.git] / t / testmodel.py
blob742b36918249f2982ae198311577b81360d74eec
1 #!/usr/bin/env python
2 import os
3 from ugit.model import Model
5 class TestModel(Model):
6 def init(self):
7 duck = Model().create(sound='quack',name='ducky')
8 goose = Model().create(sound='cluck',name='goose')
10 self.create(
11 attribute = 'value',
12 mylist=[duck,duck,goose]
14 self.hello = 'world'
15 self.set_mylist([duck,duck,goose, 'meow', 'caboose',42])
17 def testMethod(self):
18 return 'test'
21 class InnerModel(Model):
22 def init(self):
23 self.create(foo = 'bar')
25 class NestedModel(Model):
26 def init(self):
27 self.create(
28 inner = InnerModel(),
29 innerList = [],
30 normaList = [ 1,2,3, [4,5, [6,7,8], 9]],
32 self.innerList.append(InnerModel())
33 self.innerList.append([InnerModel()])
34 self.innerList.append([[InnerModel()]])
35 self.innerList.append([[[InnerModel(),InnerModel()]]])
36 self.innerList.append({"foo": InnerModel()})