Skip to content

Commit

Permalink
test: 修改时间戳测试文件名
Browse files Browse the repository at this point in the history
  • Loading branch information
Johnserf-Seed committed Apr 11, 2024
1 parent 961a8ed commit cce3eae
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion tests/test_timestamp_2_str.py → tests/test_timestamp.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
import pytest
from f2.utils.utils import timestamp_2_str
from f2.utils.utils import get_timestamp, timestamp_2_str


class TestGetTimestamp:
def test_get_timestamp(self):
print(get_timestamp())
assert len(str(get_timestamp())) == 13

def test_get_timestamp_with_unit(self):
assert len(str(get_timestamp("sec"))) == 10

def test_get_timestamp_with_invalid_unit(self):
with pytest.raises(ValueError):
get_timestamp("invalid_unit")


class TestTimestamp2Str:
Expand Down

0 comments on commit cce3eae

Please sign in to comment.