diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2023-08-31 01:15:29 +0200 |
---|---|---|
committer | Trygve Aaberge <trygveaa@gmail.com> | 2024-02-18 11:32:54 +0100 |
commit | c47aeb31b5f6f1843c0505e539fdff3352c76f80 (patch) | |
tree | 4e84b08b38549549fb0ba9f50baddb8a68d0ceb4 /tests/test_slackts.py | |
parent | 994e2d246fc09ed942a871696ccae1bdc3002217 (diff) | |
download | wee-slack-c47aeb31b5f6f1843c0505e539fdff3352c76f80.tar.gz |
Support thread hash completion
Diffstat (limited to 'tests/test_slackts.py')
-rw-r--r-- | tests/test_slackts.py | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/tests/test_slackts.py b/tests/test_slackts.py new file mode 100644 index 0000000..ab60d03 --- /dev/null +++ b/tests/test_slackts.py @@ -0,0 +1,87 @@ +from slack.slack_message import SlackTs + +str_base = "1234567890.012345" +str_base_not_padded = "1234567890.12345" +str_different_minor = "1234567890.012346" +str_different_major = "1234567891.012345" + +ts_base = SlackTs(str_base) +ts_base_not_padded = SlackTs(str_base_not_padded) +ts_different_minor = SlackTs(str_different_minor) +ts_different_major = SlackTs(str_different_major) + + +def test_slackts_eq(): + assert ts_base == ts_base + assert ts_base == ts_base_not_padded + assert ts_base == str_base + assert not ts_base == ts_different_minor + assert not ts_base == ts_different_major + assert not ts_base == str_different_minor + assert not ts_base == str_different_major + + +def test_slackts_ne(): + assert ts_base != ts_different_minor + assert ts_base != ts_different_major + assert ts_base != str_different_minor + assert ts_base != str_different_major + assert not ts_base != ts_base + assert not ts_base != ts_base_not_padded + assert not ts_base != str_base + + +def test_slackts_gt(): + assert ts_different_minor > ts_base + assert ts_different_major > ts_base + assert str_different_minor > ts_base + assert str_different_major > ts_base + assert not ts_base > ts_base + assert not ts_base > ts_base_not_padded + assert not ts_base > ts_different_minor + assert not ts_base > ts_different_major + assert not ts_base > str_base + assert not ts_base > str_different_minor + assert not ts_base > str_different_major + + +def test_slackts_ge(): + assert ts_base >= ts_base + assert ts_base >= ts_base_not_padded + assert ts_different_minor >= ts_base + assert ts_different_major >= ts_base + assert ts_base >= str_base + assert str_different_minor >= ts_base + assert str_different_major >= ts_base + assert not ts_base >= ts_different_minor + assert not ts_base >= ts_different_major + assert not ts_base >= str_different_minor + assert not ts_base >= str_different_major + + +def test_slackts_lt(): + assert ts_base < ts_different_minor + assert ts_base < ts_different_major + assert ts_base < str_different_minor + assert ts_base < str_different_major + assert not ts_base < ts_base + assert not ts_base < ts_base_not_padded + assert not ts_different_minor < ts_base + assert not ts_different_major < ts_base + assert not ts_base < str_base + assert not str_different_minor < ts_base + assert not str_different_major < ts_base + + +def test_slackts_le(): + assert ts_base <= ts_base + assert ts_base <= ts_base_not_padded + assert ts_base <= ts_different_minor + assert ts_base <= ts_different_major + assert ts_base <= str_base + assert ts_base <= str_different_minor + assert ts_base <= str_different_major + assert not ts_different_minor <= ts_base + assert not ts_different_major <= ts_base + assert not str_different_minor <= ts_base + assert not str_different_major <= ts_base |