DEVX-111: feat: add check_api_identity_checks, setup_ssh_key, and api utils
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
"""Unit tests for devx.utils.api."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from devx.utils.api import is_falsy, is_truthy
|
||||
|
||||
|
||||
class TestIsTruthy:
|
||||
def test_string_true(self) -> None:
|
||||
assert is_truthy("true") is True
|
||||
|
||||
def test_string_true_uppercase(self) -> None:
|
||||
assert is_truthy("True") is True
|
||||
|
||||
def test_boolean_true(self) -> None:
|
||||
assert is_truthy(True) is True
|
||||
|
||||
def test_string_false(self) -> None:
|
||||
assert is_truthy("false") is False
|
||||
|
||||
def test_boolean_false(self) -> None:
|
||||
assert is_truthy(False) is False
|
||||
|
||||
def test_none(self) -> None:
|
||||
assert is_truthy(None) is False
|
||||
|
||||
def test_empty_string(self) -> None:
|
||||
assert is_truthy("") is False
|
||||
|
||||
def test_random_string(self) -> None:
|
||||
assert is_truthy("random") is False
|
||||
|
||||
|
||||
class TestIsFalsy:
|
||||
def test_string_false(self) -> None:
|
||||
assert is_falsy("false") is True
|
||||
|
||||
def test_string_false_uppercase(self) -> None:
|
||||
assert is_falsy("False") is True
|
||||
|
||||
def test_boolean_false(self) -> None:
|
||||
assert is_falsy(False) is True
|
||||
|
||||
def test_string_true(self) -> None:
|
||||
assert is_falsy("true") is False
|
||||
|
||||
def test_boolean_true(self) -> None:
|
||||
assert is_falsy(True) is False
|
||||
|
||||
def test_none(self) -> None:
|
||||
assert is_falsy(None) is False
|
||||
|
||||
def test_empty_string(self) -> None:
|
||||
assert is_falsy("") is False
|
||||
Reference in New Issue
Block a user