scikit-learn/sklearn/utils/tests/test_bench.py

12 lines
334 B
Python

import datetime
from sklearn.utils.bench import total_seconds
from nose.tools import assert_equal
def test_total_seconds():
delta = datetime.datetime(2012, 1, 1, 5, 5, 1) - datetime.datetime(2012, 1,
1, 5, 5, 4)
assert_equal(86397, total_seconds(delta))