Exemple #1
0
 def setUp(self):
     setup_cache()
     mb_release_group.mb_session = MagicMock()
     self.mock_db = mb_release_group.mb_session.return_value.__enter__.return_value
     # Mock sql query for fetching release groups and alter the return value to return SQLAlchemy objects.
     self._release_group_query = self.mock_db.query.return_value.options.return_value.options.return_value
     self._release_group_query_with_artists = self._release_group_query.options.return_value.options.return_value.\
         options.return_value
     self.release_group_query = self._release_group_query.filter.return_value.all
     self.release_group_query_with_artists = self._release_group_query_with_artists.filter.return_value.all
 def setUp(self):
     setup_cache()
     mb_release_group.mb_session = MagicMock()
     self.mock_db = mb_release_group.mb_session.return_value.__enter__.return_value
     # Mock sql query for fetching release groups and alter the return value to return SQLAlchemy objects.
     self._release_group_query = self.mock_db.query.return_value.options.return_value.options.return_value
     self._release_group_query_with_artists = self._release_group_query.options.return_value.options.return_value.\
         options.return_value
     self.release_group_query = self._release_group_query.filter.return_value.all
     self.release_group_query_with_artists = self._release_group_query_with_artists.filter.return_value.all
Exemple #3
0
 def setUp(self):
     setup_cache()
     mb_event.mb_session = MagicMock()
     self.mock_db = mb_event.mb_session.return_value.__enter__.return_value
     self.event_query = self.mock_db.query.return_value.filter.return_value.all
 def setUp(self):
     setup_cache()
     mb_artist.mb_session = MagicMock()
     self.mock_db = mb_artist.mb_session.return_value.__enter__.return_value
     self.artist_query = self.mock_db.query.return_value.options.return_value.filter.return_value.all
Exemple #5
0
 def setUp(self):
     setup_cache()
     mb_place.mb_session = MagicMock()
     self.mock_db = mb_place.mb_session.return_value.__enter__.return_value
     self.place_query = self.mock_db.query.return_value.options.return_value.options.return_value.filter.return_value.all