Exemplo n.º 1
0
    def test_mean_by_file_deprecation_warning(self):
        """Test generation of deprecation warning for mean_by_file"""

        with warnings.catch_warnings(record=True) as war:
            try:
                avg.mean_by_file(None, 'dummy1')
            except TypeError:
                # Setting inst to None should produce a TypeError after
                # warning is generated
                pass

        assert len(war) >= 1
        assert war[0].category == DeprecationWarning
Exemplo n.º 2
0
 def test_basic_file_mean(self):
     """Test basic file mean"""
     index = pds.date_range(*self.bounds1)
     names = [date.strftime('%Y-%m-%d')+'.nofile' for date in index]
     self.testInst.bounds = (names[0], names[-1])
     ans = avg.mean_by_file(self.testInst, 'dummy4')
     assert np.all(ans == 86399/2.0)