def setUp(self): b = Bag('Everything', pathname='/tmp') e1 = Entity(title="example #1", creator="Matt", importance="Really important") e2 = Entity(title="example #2", creator="Matt", importance="not very") b.append(e1) b.append(e2) self.b = b
def test_order_2(): b = Bag() b.append(pitz.entity.Entity(title='blah', difficulty='easy', status='unstarted')) b.append(pitz.entity.Entity(title='blah', difficulty='hard', status='unstarted')) b.order_method = None b.order()
def test_values(): b = Bag() b.append(pitz.entity.Entity(title='blah', difficulty='easy', status='unstarted')) b.append(pitz.entity.Entity(title='blah', difficulty='hard', status='unstarted')) v = b.values('difficulty') assert len(v) == 2 assert ('easy', 1) in v assert ('hard', 1) in v
def test_append_1(): b = Bag() b.append(pitz.entity.Entity(title='blah', status='irrelevant'))
def test_grep_2(self): b = Bag() b.pathname = '/tmp' assert b.grep('foo') == b
def test_contents_1(): b = Bag() b.append(Entity(title='A'))