def test_registration(): """register a worker, can we get it back?""" flac = flacbase.copy() w = workers.Worker(**flac) r = workers.registry r.register(w) p = r.worker(flac['fmt']) tools.eq_(p, w)
def test_unregistration1(): """Register a worker, unregister it, does it still exist?""" flac = flacbase.copy() w = workers.Worker(**flac) r = workers.registry r.register(w) r.unregister(flac['fmt']) r.worker(flac['fmt'])
def test_creation(): """Create a worker - does it have the right attributes?""" flac = flacbase.copy() w = workers.Worker(**flac) tools.eq_(w.fmt, flac['fmt']) tools.eq_(w.mutagenklass, flac['mutagenklass']) tools.eq_(w.decode, flac['decode']) tools.eq_(w.encode, flac['encode']) tools.eq_(w.decodestdout, flac['decodestdout']) tools.eq_(w.encodestdin, flac['encodestdin']) flac.pop('fmt') tools.eq_(w.kwargs, flac)