如何为以下方法编写单元测试用例?
def aggregate_ts(ts,orig_frequency,new_frequency):
if orig_frequency <= new_frequency:
# print(ts.name ,new_frequency)
if ts.dtypes != 'object':
ts_new = ts.resample(str(new_frequency)+ 's').first().interpolate()
else:
ts_new = ts.resample(str(new_frequency)+ 's').first()
else:
# print(ts.name,orig_frequency)
if ts.dtypes != 'object':
ts_new = ts.resample(str(orig_frequency)+ 's'0.first().interpolate()
else:
ts_new = ts.resample(str(orig_frequency)+'s').first()
# print(ts_new.name, ts_new.dtypes)
return ts_new