code: def test_with_modalities(self):
      data = Reader().read("./tests/data.txt")
      sentiment_data = Reader().read(
          "./tests/sentiment_data.txt",
          fmt="UITup",
          sep=",",
          tup_sep=":",
      )
      review_data = Reader().read("./tests/review.txt", fmt="UIReview")
      bm = BaseMethod.from_splits(
          train_data=data[:-1], test_data=data[-1:]
      )
  
      self.assertIsNone(bm.user_feature)
      self.assertIsNone(bm.user_text)
      self.assertIsNone(bm.item_feature)
      self.assertIsNone(bm.item_text)
      self.assertIsNone(bm.user_image)
      self.assertIsNone(bm.item_image)
      self.assertIsNone(bm.user_graph)
      self.assertIsNone(bm.item_graph)
      self.assertIsNone(bm.sentiment)
  
      bm.user_feature = FeatureModality()
      bm.user_text = TextModality()
      bm.item_text = ReviewModality(data=review_data, filter_by="item")
      bm.item_image = ImageModality()
      bm.sentiment = SentimentModality(data=sentiment_data)
      bm._build_modalities()
  
      try:
          bm.user_feature = ()
      except ValueError:
          assert True
  
      try:
          bm.item_feature = ()
      except ValueError:
          assert True
  
      try:
          bm.user_text = ImageModality()
      except ValueError:
          assert True
  
      try:
          bm.item_text = ImageModality()
      except ValueError:
          assert True
  
      try:
          bm.user_image = TextModality()
      except ValueError:
          assert True
  
      try:
          bm.item_image = TextModality()
      except ValueError:
          assert True
  
      try:
          bm.user_graph = TextModality()
      except ValueError:
          assert True
  
      try:
          bm.item_graph = ImageModality()
      except ValueError:
          assert True
  
      try:
          bm.sentiment = TextModality()
      except ValueError:
          assert True
  
      try:
          bm.sentiment = ImageModality()
      except ValueError:
          assert True
  
file_path: cornac/tests/cornac/eval_methods/test_base_method.py
imports: import unittest
  from cornac.eval_methods import BaseMethod
  from cornac.data import FeatureModality, TextModality, ReviewModality, ImageModality, SentimentModality
  from cornac.data import Dataset, Reader
  from cornac.metrics import MAE, AUC
  from cornac.models import MF
label_desc: Use image node_id 5 for calling the TestBaseMethod obj's underlying member method code with example usage: obj.test_with_modalities() without return types