Skip to content

Commit

Permalink
Tests: Add Basic test for graph command
Browse files Browse the repository at this point in the history
  • Loading branch information
reglim committed Sep 14, 2023
1 parent 92cb663 commit 8655777
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions system/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ requests-unixsocket
python-swiftclient
flake8
termcolor
pillow
3 changes: 3 additions & 0 deletions system/t13_graph/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"""
Testing Aptly Graph Command
"""
25 changes: 25 additions & 0 deletions system/t13_graph/graph.py
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()

0 comments on commit 8655777

Please sign in to comment.