Exemplo n.º 1
0
#-*- coding: utf-8 -*-

from spec.unit.fixtures import Internal, patch_gpod_module

gpod = patch_gpod_module()

from ipodio.track import Track
from ipodio.database import Database

from expects import expect
from mamba import describe, context, before

with describe(Database) as _:

    with context('when fabricated'):

        def should_have_an_internal_database():
            expect(_.fabricated.internal).to.be.an(_.internal_class)

    with context('when constructed'):

        def should_have_an_empty_index():
            expect(_.database.index).to.be.empty

        def should_be_marked_as_not_updated():
            expect(_.database.updated).to.be.false

        with context('when calling find_by_hash'):

            def should_return_an_empty_collection():
                expect(_.database.find_by_hash(_.hash)).to.be.empty
Exemplo n.º 2
0
# -*- coding: utf-8 -*-

from spec.unit.fixtures import Internal, patch_gpod_module

patch_gpod_module()

from ipodio.track import Track

from expects import expect
from mockito import mock, spy, when, verify, any
from mamba import describe, context, before

with describe(Track) as _:

    with context('when fabricated'):

        def should_have_an_internal_track():
            expect(_.fabricated_track.internal).to.be.an(_.internal_class)

    with context('when constructed'):

        def should_have_an_internal_track_():
            expect(_.track.internal).to.be.an(_.internal_class)

        def should_set_hash_to_none():
            expect(_.track.hash).to.be(None)

    with context('when update_hash'):

        def should_compute_hash():
            track = spy(_.track)
Exemplo n.º 3
0
# -*- coding: utf-8 -*-

from spec.unit.fixtures import Internal, patch_gpod_module

patch_gpod_module()

from ipodio.track import Track

from expects import expect
from mockito import mock, spy, when, verify, any
from mamba import describe, context, before


with describe(Track) as _:

    with context("when fabricated"):

        def should_have_an_internal_track():
            expect(_.fabricated_track.internal).to.be.an(_.internal_class)

    with context("when constructed"):

        def should_have_an_internal_track_():
            expect(_.track.internal).to.be.an(_.internal_class)

        def should_set_hash_to_none():
            expect(_.track.hash).to.be(None)

    with context("when update_hash"):

        def should_compute_hash():
Exemplo n.º 4
0
# -*- coding: utf-8 -*-


from spec.unit.fixtures import Internal, patch_gpod_module

gpod = patch_gpod_module()

from ipodio.track import Track
from ipodio.database import Database

from expects import expect
from mamba import describe, context, before


with describe(Database) as _:

    with context("when fabricated"):

        def should_have_an_internal_database():
            expect(_.fabricated.internal).to.be.an(_.internal_class)

    with context("when constructed"):

        def should_have_an_empty_index():
            expect(_.database.index).to.be.empty

        def should_be_marked_as_not_updated():
            expect(_.database.updated).to.be.false

        with context("when calling find_by_hash"):