Skip to content

Commit 1ff6a5b

Browse files
committed
Merge pull request #133 from GoogleCloudPlatform/compute-test
Make create_instance_test fail on bad output.
2 parents 19ce263 + 0f42220 commit 1ff6a5b

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

compute/api/create_instance_test.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
# See the License for the specific language governing permissions and
1212
# limitations under the License.
1313

14+
import re
15+
1416
from nose.plugins.attrib import attr
1517
import tests
1618

@@ -21,10 +23,20 @@
2123
class TestComputeGettingStarted(tests.CloudBaseTest):
2224

2325
def test_main(self):
24-
with tests.capture_stdout():
26+
with tests.capture_stdout() as mock_stdout:
2527
main(
2628
self.project_id,
2729
self.bucket_name,
2830
'us-central1-f',
2931
'test-instance',
3032
wait=False)
33+
34+
stdout = mock_stdout.getvalue()
35+
36+
expected_output = re.compile(
37+
(r'Instances in project %s and zone us-central1-.* - test-instance'
38+
r'.*Deleting instance.*done..$') % self.project_id,
39+
re.DOTALL)
40+
self.assertRegexpMatches(
41+
stdout,
42+
expected_output)

0 commit comments

Comments
 (0)