Ejemplo n.º 1
0
    def setUpClass(cls):
        indexers_config = {
            "indexer_1": {
                "movies": {
                    "active": True,
                    "action": "search",
                    "params": {
                        "cat": 102183
                    }
                },
                "wrong_cat": {
                    "active": False,
                    "action": "search"
                }
            },
            "indexer_2": {
                "series": {
                    "active": True,
                    "action": "search",
                    "params": {
                        "cat": 102185
                    }
                }
            }
        }
        cls.indexers_patch = patch.dict('mediastrends.indexers_config',
                                        indexers_config,
                                        clear=True)
        cls.indexers_mock = cls.indexers_patch.start()

        trackers_config = {
            'tracker_1': {
                'active': True,
                'scheme': 'http',
                'netloc': 'netloc:8080',
            },
            'tracker_2': {
                'active': True,
                'scheme': 'udp',
                'netloc': 'netloc:6060',
            },
            'tracker_3': {
                'active': False,
                'scheme': 'udp',
                'netloc': 'netloc:5217',
            },
        }
        cls.trackers_patch = patch.dict('mediastrends.trackers_config',
                                        trackers_config,
                                        clear=True)
        cls.trackers_mock = cls.trackers_patch.start()

        # db
        db_factory.defaut_instance = 'sqlite-app-test'
        PDbManager.create_database(db_factory.get_instance())
Ejemplo n.º 2
0
def setUpModule():
    db_factory.defaut_instance = 'sqlite-app-test'
    PDbManager.create_database(db_factory.get_instance())