-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
42c3621
commit 166d3bf
Showing
2 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from pathlib import Path | ||
|
||
from myterial import orange, salmon | ||
from rich import print | ||
from PIL import Image | ||
from brainrender import Scene | ||
|
||
def test_screenshot(tmp_path): | ||
filename = "screenshot.png" | ||
scene = Scene( | ||
screenshots_folder=tmp_path, | ||
) | ||
scene.add_brain_region("TH") | ||
scene.render(interactive=False, zoom=2) | ||
scene.screenshot(name=filename) | ||
scene.close() | ||
|
||
test_filepath = tmp_path / filename | ||
assert test_filepath.exists() | ||
|
||
img1 = Image.open(test_filepath) | ||
assert img1.size == (1600, 1200) |