Example #1
0
 def test_get_dates(self, mock_read_json):
     """ Test the reporting dates. """
     mock_read_json.return_value = COMPACT_HISTORY
     history = CompactHistory('history_file_name.json')
     self.assertEqual(
         '2013-02-28 17:01:45,2013-02-28 17:16:45,2013-03-05 17:16:45',
         history.get_dates())
    def test_get_dates_long_limit(self, mock_read_json):
        """ Test he reporting dates are limited to 2000 for long history. """
        mock_read_json.return_value = {
            "dates": ["2013-02-28 17:01:45"] * 2001,
            "metrics": {},
            "statuses": []
        }
        history = CompactHistory('history_file_name.json')

        self.assertEqual(','.join(['2013-02-28 17:01:45'] * 2000),
                         history.get_dates(long_history=True))
 def test_get_dates(self, mock_read_json):
     """ Test the reporting dates. """
     mock_read_json.return_value = COMPACT_HISTORY
     history = CompactHistory('history_file_name.json')
     self.assertEqual(DATE2 + ',' + DATE3 + ',' + DATE4,
                      history.get_dates())
Example #4
0
    def test_get_dates_long_limit(self, mock_read_json):
        """ Test he reporting dates are limited to 2000 for long history. """
        mock_read_json.return_value = {"dates": ["2013-02-28 17:01:45"] * 2001, "metrics": {}, "statuses": []}
        history = CompactHistory('history_file_name.json')

        self.assertEqual(','.join(['2013-02-28 17:01:45'] * 2000), history.get_dates(long_history=True))
Example #5
0
 def test_get_dates(self, mock_read_json):
     """ Test the reporting dates. """
     mock_read_json.return_value = COMPACT_HISTORY
     history = CompactHistory('history_file_name.json')
     self.assertEqual(DATE2 + ',' + DATE3 + ',' + DATE4, history.get_dates())