code: def test_test_loader(dataset_ncf_files_sorted):
      train_path, _, leave_one_out_test_path = dataset_ncf_files_sorted
      leave_one_out_test = pd.read_csv(leave_one_out_test_path)
      test_users = leave_one_out_test[DEFAULT_USER_COL].unique()
  
      n_neg = 1
      n_neg_test = 1
      dataset = Dataset(
          train_path,
          test_file=leave_one_out_test_path,
          n_neg=n_neg,
          n_neg_test=n_neg_test,
      )
      assert set(dataset.test_full_datafile.users) == set(test_users)
  
      # test number of batches and data size is as expected after loading all test data
      expected_test_batches = leave_one_out_test.shape[0]
      assert (
          max(dataset.test_full_datafile.batch_indices_range) + 1
          == expected_test_batches
      )
      batch_records = []
      for batch in dataset.test_loader(yield_id=True):
          assert type(batch[0][0]) == int
          assert type(batch[1][0]) == int
          assert type(batch[2][0]) == float
          batch_data = {
              DEFAULT_USER_COL: [
                  dataset.id2user[user] for user in batch[0]
              ],
              DEFAULT_ITEM_COL: [
                  dataset.id2item[item] for item in batch[1]
              ],
              DEFAULT_RATING_COL: batch[2],
          }
          batch_records.append(pd.DataFrame(batch_data))
  
      assert len(batch_records) == expected_test_batches
      test_loader_df = pd.concat(batch_records).reset_index(drop=True)
      assert (
          test_loader_df.shape[0]
          == expected_test_batches * n_neg_test * 2
      )
      assert set(test_loader_df[DEFAULT_USER_COL]) == set(test_users)
  
file_path: recommenders/tests/unit/recommenders/models/test_ncf_dataset.py
imports: import os
  import pytest
  import pandas
  from recommenders.utils.constants import DEFAULT_USER_COL, DEFAULT_ITEM_COL, DEFAULT_RATING_COL, DEFAULT_TIMESTAMP_COL
  from recommenders.models.ncf.dataset import DataFile, NegativeSampler, Dataset, EmptyFileException, MissingFieldsException, FileNotSortedException, MissingUserException
label_desc: Use image node_id 7 for calling a global function with example usage: test_test_loader(dataset_ncf_files_sorted) without return types