@@ -0,0 +1,533 @@
+import hashlib%0A%0Afrom virtool.utils import random_alphanumeric%0Afrom virtool.users import hash_password, check_password, check_legacy_password%0A%0A%0Aclass TestHashPassword:%0A%0A    def test_basic(self):%0A        assert check_password(%22hello_world%22, hash_password(%22hello_world%22))%0A%0A%0Aclass TestLegacyHashPassword:%0A%0A    def test_basic(self):%0A        salt = random_alphanumeric(24)%0A%0A        hashed = hashlib.sha512(salt.encode(%22utf-8%22) + %22hello_world%22.encode(%22utf-8%22)).hexdigest()%0A%0A        assert check_legacy_password(%22hello_world%22, salt, hashed)%0A

Add tests for password hashing and checking