We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f2e19a5 commit 0f42220Copy full SHA for 0f42220
1 file changed
compute/api/create_instance_test.py
@@ -11,6 +11,8 @@
11
# See the License for the specific language governing permissions and
12
# limitations under the License.
13
14
+import re
15
+
16
from nose.plugins.attrib import attr
17
import tests
18
@@ -21,10 +23,20 @@
21
23
class TestComputeGettingStarted(tests.CloudBaseTest):
22
24
25
def test_main(self):
- with tests.capture_stdout():
26
+ with tests.capture_stdout() as mock_stdout:
27
main(
28
self.project_id,
29
self.bucket_name,
30
'us-central1-f',
31
'test-instance',
32
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