summaryrefslogtreecommitdiff
path: root/tests/test.py
diff options
context:
space:
mode:
authorMitja Felicijan <mitja.felicijan@gmail.com>2026-01-22 00:46:42 +0100
committerMitja Felicijan <mitja.felicijan@gmail.com>2026-01-22 00:46:42 +0100
commit3abc76cce48f3ae66e28ec99af648dc5fdf8bf4a (patch)
tree9d17390261bbfe5fcfbf349104a9af85f30e6a9d /tests/test.py
parent52040cc19cbdca48f91d4eb91e9b7a782bb5fbd0 (diff)
downloadcrep-3abc76cce48f3ae66e28ec99af648dc5fdf8bf4a.tar.gz
Add better tests and testing suit
Diffstat (limited to 'tests/test.py')
-rw-r--r--tests/test.py48
1 files changed, 18 insertions, 30 deletions
diff --git a/tests/test.py b/tests/test.py
index 4479f5c..3dbf524 100644
--- a/tests/test.py
+++ b/tests/test.py
@@ -1,32 +1,20 @@
-def set_password(args):
- password = args.password
- while not password :
- password1 = getpass("" if args.quiet else "Provide password: ")
- password_repeat = getpass("" if args.quiet else "Repeat password: ")
- if password1 != password_repeat:
- print("Passwords do not match, try again")
- elif len(password1) < 4:
- print("Please provide at least 4 characters")
- else:
- password = password1
+def hello():
+ print("Hello, world!")
- password_hash = passwd(password)
- cfg = BaseJSONConfigManager(config_dir=jupyter_config_dir())
- cfg.update('jupyter_notebook_config', {
- 'NotebookApp': {
- 'password': password_hash,
- }
- })
- if not args.quiet:
- print("password stored in config dir: %s" % jupyter_config_dir())
+def add(a, b):
+ return a + b
-def main(argv):
- parser = argparse.ArgumentParser(argv[0])
- subparsers = parser.add_subparsers()
- parser_password = subparsers.add_parser('password', help='sets a password for your notebook server')
- parser_password.add_argument("password", help="password to set, if not given, a password will be queried for (NOTE: this may not be safe)",
- nargs="?")
- parser_password.add_argument("--quiet", help="suppress messages", action="store_true")
- parser_password.set_defaults(function=set_password)
- args = parser.parse_args(argv[1:])
- args.function(args)
+def complex_function(a, b, c=None, *args, **kwargs):
+ """A more complex function."""
+ pass
+
+async def async_hello():
+ print("Async hello")
+
+class MyClass:
+ def method_one(self):
+ pass
+
+ @staticmethod
+ def static_method():
+ pass