def test_get_class_init_args_on_storage(): from vdirsyncer.storage.memory import MemoryStorage all, required = utils.get_class_init_args(MemoryStorage) assert all == set(['fileext', 'collection', 'read_only', 'instance_name', 'collection_human']) assert not required
def test_get_class_init_args(): class Foobar(object): def __init__(self, foo, bar, baz=None): pass all, required = utils.get_class_init_args(Foobar) assert all == {'foo', 'bar', 'baz'} assert required == {'foo', 'bar'}