Esempio n. 1
0
def _introspect_tables():
    for klass in itertools.chain(get_all_classes('stoqlib/domain'),
                                 get_all_classes('plugins')):
        try:
            if not issubclass(klass, ORMObject):
                continue
        except TypeError:
            continue

        if getattr(klass, '__storm_table__', 'invalid') == 'invalid':
            continue

        yield klass
Esempio n. 2
0
def _get_all_views():
    for klass in get_all_classes('stoqlib/domain'):
        try:
            # Exclude Viewable, since we just want to test it's subclasses
            if not issubclass(klass, Viewable) or klass is Viewable:
                continue
        except TypeError:
            continue

        yield klass
Esempio n. 3
0
    def _get_all_searches(cls):
        for klass in get_all_classes('stoqlib/gui'):
            try:
                if klass.__name__ in cls.ignored_classes:
                    continue
                # Exclude SearchDialog, since we just want to test it's subclasses
                if not issubclass(klass, SearchDialog) or klass is SearchDialog:
                    continue
            except TypeError:
                continue

            yield klass
Esempio n. 4
0
def _get_all_views():
    for klass in get_all_classes('stoqlib/domain'):
        try:
            # Exclude Viewable, since we just want to test it's subclasses
            if not issubclass(klass, Viewable) or klass is Viewable:
                continue
            # This is a base viewable for other classes that should not be
            # tested.
            if klass.__name__ == 'BaseTransferView':
                continue
        except TypeError:
            continue

        yield klass
Esempio n. 5
0
def _get_all_views():
    for klass in get_all_classes('stoqlib/domain'):
        try:
            # Exclude Viewable, since we just want to test it's subclasses
            if not issubclass(klass, Viewable) or klass is Viewable:
                continue
            # This is a base viewable for other classes that should not be
            # tested.
            if klass.__name__ == 'BaseTransferView':
                continue
        except TypeError:
            continue

        yield klass