diff --git a/system/requirements.txt b/system/requirements.txt index 39b43f156..fd1a229d1 100644 --- a/system/requirements.txt +++ b/system/requirements.txt @@ -4,3 +4,4 @@ requests-unixsocket python-swiftclient flake8 termcolor +pillow diff --git a/system/t13_graph/__init__.py b/system/t13_graph/__init__.py new file mode 100644 index 000000000..9c738a636 --- /dev/null +++ b/system/t13_graph/__init__.py @@ -0,0 +1,3 @@ +""" +Testing Aptly Graph Command +""" diff --git a/system/t13_graph/graph.py b/system/t13_graph/graph.py new file mode 100644 index 000000000..4dfe1617d --- /dev/null +++ b/system/t13_graph/graph.py @@ -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()