Browse Source

autoformat

Getty Ritter 4 years ago
parent
commit
83fb78636c
5 changed files with 10 additions and 11 deletions
  1. 1 0
      lc/error.py
  2. 1 4
      lc/model.py
  3. 4 2
      stubs/passlib/apps.py
  4. 3 1
      stubs/peewee.py
  5. 1 4
      tests/model.py

+ 1 - 0
lc/error.py

@@ -1,5 +1,6 @@
 from dataclasses import dataclass
 
+
 @dataclass
 class UserExists(Exception):
     name: str

+ 1 - 4
lc/model.py

@@ -26,10 +26,7 @@ class User(Model):
     def from_request(user: r.User) -> "User":
         passhash = pwd.hash(user.password)
         try:
-            return User.create(
-                name=user.name,
-                passhash=passhash,
-            )
+            return User.create(name=user.name, passhash=passhash,)
         except peewee.IntegrityError:
             raise e.UserExists(name=user.name)
 

+ 4 - 2
stubs/passlib/apps.py

@@ -1,6 +1,8 @@
 class custom_app_context:
     @staticmethod
-    def hash(password: str) -> str: pass
+    def hash(password: str) -> str:
+        pass
 
     @staticmethod
-    def verify(password: str, hash: str) -> bool: pass
+    def verify(password: str, hash: str) -> bool:
+        pass

+ 3 - 1
stubs/peewee.py

@@ -45,4 +45,6 @@ def BooleanField(unique: bool = False) -> Any:
 def ForeignKeyField(key: object, null: bool = None, backref: str = "") -> Any:
     pass
 
-class IntegrityError(Exception): pass
+
+class IntegrityError(Exception):
+    pass

+ 1 - 4
tests/model.py

@@ -16,10 +16,7 @@ class TestDB:
         c.DB.close()
 
     def mk_user(self, name="gdritter", password="foo") -> m.User:
-        return m.User.from_request(r.User(
-            name=name,
-            password=password,
-        ))
+        return m.User.from_request(r.User(name=name, password=password,))
 
     def test_create_user(self):
         name = "gdritter"