11import sys
22import types
33import logging
4- import builtins
54import pytest
65
76import gardenlinux .features .cname_main as cname_main
87
98
109def test_main_happy (monkeypatch , capsys ):
10+ """
11+ Test the "Happy Path" of the main() function.
12+ """
1113 # Arrange
1214 argv = ["prog" , "--arch" , "amd64" , "--version" , "1.0-abc123" , "flav-amd64" ]
1315 monkeypatch .setattr (sys , "argv" , argv )
@@ -47,6 +49,9 @@ def sort_graph_nodes(graph):
4749
4850
4951def test_main_version_from_file (monkeypatch , capsys ):
52+ """
53+ "Happy Path" test for grabbing the version and commit id from file in main().
54+ """
5055 # Arrange
5156 argv = ["prog" , "--arch" , "amd64" , "flav-amd64" ]
5257 monkeypatch .setattr (sys , "argv" , argv )
@@ -139,7 +144,7 @@ def sort_graph_nodes(graph):
139144 assert "Failed to parse version information" in caplog .text
140145
141146
142- def test_cname_main_invalid_cname (monkeypatch ):
147+ def test_cname_main_invalid_cname_raises (monkeypatch ):
143148 """
144149 Test if AssertionError is raised with an invalid or malformed cname.
145150 """
@@ -152,7 +157,7 @@ def test_cname_main_invalid_cname(monkeypatch):
152157 cname_main .main ()
153158
154159
155- def test_cname_main_missing_arch_in_cname (monkeypatch ):
160+ def test_cname_main_missing_arch_in_cname_raises (monkeypatch ):
156161 """
157162 Test if an assertion error is raised when the arch argument is missing.
158163 """
0 commit comments