Skip to content

Commit d9d3b32

Browse files
Delta: test delta
1 parent b9c36c6 commit d9d3b32

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

tests/test_delta.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright (c) 2022-2024 J. D. Mitchell
2+
#
3+
# Distributed under the terms of the GPL license version 3.
4+
#
5+
# The full license is in the file LICENSE, distributed with this software.
6+
"""
7+
This module contains some tests for the delta function.
8+
"""
9+
10+
from datetime import datetime, timedelta
11+
from time import sleep
12+
13+
from libsemigroups_pybind11 import delta
14+
15+
16+
def test_delta():
17+
current_time = datetime.now()
18+
wait_time = 10**-3
19+
sleep(wait_time)
20+
diff = delta(current_time)
21+
assert isinstance(diff, timedelta)
22+
assert diff > timedelta(seconds=wait_time)

0 commit comments

Comments
 (0)