You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tests/test_vagrant.py
+29Lines changed: 29 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -197,6 +197,35 @@ def test_parse_status():
197
197
assertgoal==parsed, 'The parsing of the test listing did not match the goal.\nlisting={!r}\ngoal={!r}\nparsed_listing={!r}'.format(listing, goal, parsed)
198
198
199
199
200
+
@with_setup(make_setup_vm(), teardown_vm)
201
+
deftest_parse_aws_status():
202
+
'''
203
+
Test the parsing the output of the `vagrant status` command for an aws instance.
1462351217,default,state-human-long,The EC2 instance is running. To stop this machine%!(VAGRANT_COMMA) you can run\\n`vagrant halt`. To destroy the machine%!(VAGRANT_COMMA) you can run `vagrant destroy`.
218
+
1462351217,default,action,read_state,start
219
+
1462351219,default,action,read_state,end
220
+
1462351219,,ui,info,Current machine states:\\n\\ndefault (aws)\\n\\nThe EC2 instance is running. To stop this machine%!(VAGRANT_COMMA) you can run\\n`vagrant halt`. To destroy the machine%!(VAGRANT_COMMA) you can run `vagrant destroy`.
221
+
'''
222
+
# Can compare tuples to Status class b/c Status is a collections.namedtuple.
223
+
goal= [('default', 'running', 'aws')]
224
+
v=vagrant.Vagrant(TD)
225
+
parsed=v._parse_status(listing)
226
+
assertgoal==parsed, 'The parsing of the test listing did not match the goal.\nlisting={!r}\ngoal={!r}\nparsed_listing={!r}'.format(listing, goal, parsed)
0 commit comments