def test_getitem_from_tuple_should_cache_categories_after_first_time(self):
     reporter = IndicadorsMatrixDataReporter(self.client, "service-1")
     reporter._getitem_from_tuple((1, 1))
     with patch(
         "genweb.serveistic.data_access.indicadors." "IndicadorsMatrixDataReporter._retrieve_categories"
     ) as retrieve_categories:
         reporter._getitem_from_tuple((1, 1))
         self.assertEqual(0, retrieve_categories.call_count)
 def test_getitem_from_tuple_should_cache_categories_after_first_time(self):
     reporter = IndicadorsMatrixDataReporter(self.client, 'service-1')
     reporter._getitem_from_tuple((1, 1))
     with patch(
             "genweb.serveistic.data_access.indicadors."
             "IndicadorsMatrixDataReporter._retrieve_categories") as retrieve_categories:
         reporter._getitem_from_tuple((1, 1))
         self.assertEqual(0, retrieve_categories.call_count)
 def test_getitem_from_tuple_should_return_right_category(self):
     reporter = IndicadorsMatrixDataReporter(self.client, "service-1")
     self.assertEquals("category-1.2", reporter._getitem_from_tuple((1, 2)).identifier)
 def test_getitem_from_tuple_should_raise_indexerror_if_index_is_gtsize(self):
     reporter = IndicadorsMatrixDataReporter(self.client, "service-1")
     with self.assertRaises(IndexError):
         reporter._getitem_from_tuple((1, 4))
 def test_getitem_from_tuple_should_return_right_category(self):
     reporter = IndicadorsMatrixDataReporter(self.client, 'service-1')
     self.assertEquals(
         'category-1.2', reporter._getitem_from_tuple((1, 2)).identifier)
 def test_getitem_from_tuple_should_raise_indexerror_if_index_is_gtsize(self):
     reporter = IndicadorsMatrixDataReporter(self.client, 'service-1')
     with self.assertRaises(IndexError):
         reporter._getitem_from_tuple((1, 4))