diff options
author | Richard van der Hoff <1389908+richvdh@users.noreply.github.com> | 2021-05-12 15:04:51 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-12 15:04:51 +0100 |
commit | 7562d887e159f404c8d752271310f4432f246656 (patch) | |
tree | 0b59ec04cf218ef5dd3172642bdfc531bb3f187e /tests/util | |
parent | Run cache_joined_hosts_for_event in background (#9951) (diff) | |
download | synapse-7562d887e159f404c8d752271310f4432f246656.tar.xz |
Change the format of access tokens away from macaroons (#5588)
Diffstat (limited to 'tests/util')
-rw-r--r-- | tests/util/test_stringutils.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/util/test_stringutils.py b/tests/util/test_stringutils.py index f7fecd9cf3..ad4dd7f007 100644 --- a/tests/util/test_stringutils.py +++ b/tests/util/test_stringutils.py @@ -13,7 +13,7 @@ # limitations under the License. from synapse.api.errors import SynapseError -from synapse.util.stringutils import assert_valid_client_secret +from synapse.util.stringutils import assert_valid_client_secret, base62_encode from .. import unittest @@ -45,3 +45,9 @@ class StringUtilsTestCase(unittest.TestCase): for client_secret in bad: with self.assertRaises(SynapseError): assert_valid_client_secret(client_secret) + + def test_base62_encode(self): + self.assertEqual("0", base62_encode(0)) + self.assertEqual("10", base62_encode(62)) + self.assertEqual("1c", base62_encode(100)) + self.assertEqual("001c", base62_encode(100, minwidth=4)) |