text: import unittest
  import numpy as np
  import pandas as pd
  
  from src.classes.DataManager import DataManager
  
  
  class ReadingDataTest(unittest.TestCase):
      dataset_dir = '26-spanish-songs'
      granularities = ['sentences', 'stanzas', 'lyrics']
      model_dirs = ['w2v-s', 'roberta-m', 'glove-s']
      testset_file = '26-spanish-songs-testset'
      data_manager = DataManager(dataset_dir, granularities, model_dirs, testset_file)
  
      def test_0_find_index_cases(self):
          index_cases = self.data_manager.find_index_cases()
          self.assertIsNotNone(index_cases)
          self.assertEqual(len(index_cases), 9)
          for index_name, model, granularity in index_cases:
              self.assertIsInstance(index_name, str)
              self.assertIsInstance(model, str)
              self.assertIsInstance(granularity, str)
  
      def test_1_read_testset(self):
          testset = self.data_manager.read_testset()
          self.assertIsNotNone(testset)
          self.assertEqual(len(testset), 26)
          unique_ids = []
          similar_ids = []
          for song_id, most_similar_song_id in testset:
              self.assertIsInstance(song_id, np.uint8)
              self.assertIsInstance(most_similar_song_id, np.uint8)
              unique_ids.append(song_id)
              similar_ids.append(most_similar_song_id)
          self.assertEqual(len(unique_ids), len(set(unique_ids)))
          for similar_song_id in similar_ids:
              self.assertIn(similar_song_id, unique_ids)
  
      def test_2_read_read_dataset(self):
          dataset = self.data_manager.read_dataset('sentences')
          self.assertIsInstance(dataset, pd.DataFrame)
          shape_sentences = dataset.shape
          dataset = self.data_manager.read_dataset('stanzas')
          self.assertIsInstance(dataset, pd.DataFrame)
          shape_stanzas = dataset.shape
          dataset = self.data_manager.read_dataset('lyrics')
          self.assertIsInstance(dataset, pd.DataFrame)
          shape_lyrics = dataset.shape
          self.assertTrue(shape_sentences[0] >= shape_stanzas[0] >= shape_lyrics[0])
  
      def test_3_construct_index_name(self):
          index_name = self.data_manager.construct_index_name('w2v-s', 'stanzas')
          self.assertIsNotNone(index_name)
          self.assertIsInstance(index_name, str)
          self.assertGreater(len(index_name), 0)
          self.assertEqual(len(index_name.split('_')), 3)
  
  
  
  if __name__ == '__main__':
      unittest.main()
  
  