Esempio n. 1
0
    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
Esempio n. 2
0
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()
Esempio n. 3
0
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
Esempio n. 4
0
def test_append_1():

    b = Bag()
    b.append(pitz.entity.Entity(title='blah', status='irrelevant'))
Esempio n. 5
0
    def test_grep_2(self):

        b = Bag()
        b.pathname = '/tmp'
        assert b.grep('foo') == b
Esempio n. 6
0
def test_contents_1():

    b = Bag()
    b.append(Entity(title='A'))