-
-
Notifications
You must be signed in to change notification settings - Fork 375
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tests: Add Basic test for graph command
- Loading branch information
Showing
3 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -4,3 +4,4 @@ requests-unixsocket | |
python-swiftclient | ||
flake8 | ||
termcolor | ||
pillow |
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,3 @@ | ||
""" | ||
Testing Aptly Graph Command | ||
""" |
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,25 @@ | ||
from PIL import Image | ||
from lib import BaseTest | ||
|
||
|
||
class GraphTest1(BaseTest): | ||
""" | ||
Test that graph is generated correctly and accessible at the specified output path. | ||
""" | ||
|
||
fixtureDB = True | ||
fixturePool = True | ||
fixtureCmds = [ | ||
"aptly snapshot create snap1 from mirror gnuplot-maverick", | ||
"aptly publish snapshot -skip-signing snap1", | ||
] | ||
runCmd = "aptly graph -output=graph.png -layout=horizontal" | ||
|
||
def check(self): | ||
self.check_exists("graph.png") | ||
|
||
with Image.open("graph.png") as img: | ||
(width, height) = img.size | ||
# check is horizontal | ||
self.check_gt(width, height) | ||
img.verify() |