Skip to content

Commit

Permalink
finish comments in unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
Zsailer committed Dec 6, 2021
1 parent 2c289bb commit fe3658d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion jupyter_server/tests/services/sessions/test_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,17 +274,20 @@ async def test_bad_database_filepath(jp_runtime_dir):

# Try to write to a path that's a directory, not a file.
path_id_directory = str(jp_runtime_dir)
# Should raise an error because the path is a directory.
with pytest.raises(TraitError) as err:
SessionManager(
kernel_manager=kernel_manager,
contents_manager=ContentsManager(),
database_filepath=str(path_id_directory)
)

# Try writing to file that's not a database
# Try writing to file that's not a valid SQLite 3 database file.
non_db_file = jp_runtime_dir.joinpath("non_db_file.db")
non_db_file.write_bytes(b"this is a bad file")

# Should raise an error because the file doesn't
# start with an SQLite database file header.
with pytest.raises(TraitError) as err:
SessionManager(
kernel_manager=kernel_manager,
Expand Down

0 comments on commit fe3658d

Please sign in to comment.