mirror of
https://github.com/cryptoadvance/specter-desktop.git
synced 2026-08-13 12:33:29 +02:00
* introduction of url-prefixes and defaults * starting a cli for extensions * more verbose * extension-test-data * logger improvements * bugfixes and testing * adding clasification * rename spext -> specterext * distinguish isolated_client and refactoring * improved error-message * better error_management * fix tests * ext gen completion * fix endpoint issue * added .gitignore and txs * formatting * very basic callback-infra * beauty * fix tests, tidy up, follow-links * proper mocking for extgen * adding a test for plugins * fix tests + docs * error-handling for non existing extensions * extensiongen config and making config work for new style * avoid pollition * ups * kick * kick * proper renaming of spext * fix tests * ToDo remark * fix test finally * fix the fixing fixing test * documentation * revert mounting for all config see #1595 * fix tests * fix cypress-test * prevent pollution * revert address-data to fix test * added ID * bugfix for test-cypress
31 lines
831 B
Python
31 lines
831 B
Python
from cryptoadvance.specter.util.common import (
|
|
camelcase2snake_case,
|
|
snake_case2camelcase,
|
|
str2bool,
|
|
)
|
|
|
|
|
|
def test_str2bool():
|
|
assert not str2bool(None)
|
|
assert str2bool("true")
|
|
assert str2bool("True")
|
|
assert str2bool("tRuE")
|
|
assert not str2bool("false")
|
|
assert not str2bool("False")
|
|
assert not str2bool("fAlsE")
|
|
assert str2bool("On")
|
|
assert str2bool("oN")
|
|
assert str2bool("ON")
|
|
assert not str2bool("Off")
|
|
assert not str2bool("oFF")
|
|
assert not str2bool("OFF")
|
|
|
|
|
|
def test_camelcase2snake_case():
|
|
assert camelcase2snake_case("Service") == "service"
|
|
assert camelcase2snake_case("DeviceType") == "device_type"
|
|
|
|
|
|
def test_snake_case2camelcase():
|
|
assert snake_case2camelcase("service") == "Service"
|
|
assert snake_case2camelcase("device_Type") == "DeviceType"
|