code: def test_n_components(self, n_samples):
      X = self.data_generator.random_point(n_samples)
  
      n_components_0 = self.estimator.n_components
  
      n_components = 2
      self.estimator.n_components = n_components
  
      self.estimator.fit(X)
      self.assertEqual(self.estimator.n_components_, n_components)
  
      self.estimator.n_components = n_components_0
  
file_path: geomstats/geomstats/test_cases/learning/pca.py
imports: import pytest
  import geomstats.backend
  from geomstats.test_cases.learning._base import BaseEstimatorTestCase
label_desc: Use image node_id 3 for calling the TangentPCATestCase obj's underlying member method code with example usage: obj.test_n_components(n_samples) without return types