<s> from __future__ import absolute_import , print_function <EOL> import os <EOL> from nose import SkipTest <EOL> from testmill . main import main <EOL> from testmill . state import env <EOL> from testmill . test import * <EOL> @ systemtest <EOL> class TestSave ( TestSuite ) : <EOL> """<STR_LIT>""" <EOL> @ classmethod <EOL> def setup_class ( cls ) : <EOL> args = get_common_args ( ) <EOL> args += [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> with env . new ( ) : <EOL> status = main ( args ) <EOL> if status != <NUM_LIT:0> : <EOL> raise SkipTest ( '<STR_LIT>' ) <EOL> project , defname , instance = env . application [ '<STR_LIT:name>' ] . split ( '<STR_LIT::>' ) <EOL> appname = '<STR_LIT>' . format ( defname , instance ) <EOL> vms = [ vm [ '<STR_LIT:name>' ] for vm in env . appdef [ '<STR_LIT>' ] ] <EOL> cls . appname = appname <EOL> cls . vms = vms <EOL> def test_save ( self ) : <EOL> args = get_common_args ( ) <EOL> args += [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , self . appname , '<STR_LIT>' ] <EOL> status = main ( args ) <EOL> assert status == <NUM_LIT:0> <EOL> blueprint = env . api . get_blueprint ( env . blueprint [ '<STR_LIT:id>' ] ) <EOL> assert blueprint is not None <EOL> assert blueprint [ '<STR_LIT:id>' ] == env . blueprint [ '<STR_LIT:id>' ] <EOL> assert blueprint [ '<STR_LIT:name>' ] == env . blueprint [ '<STR_LIT:name>' ] <EOL> assert blueprint [ '<STR_LIT:state>' ] in ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> assert len ( blueprint [ '<STR_LIT>' ] ) == len ( self . vms ) <EOL> @ classmethod <EOL> def teardown_class ( cls ) : <EOL> args = get_common_args ( ) <EOL> args += [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> with env . new ( ) : <EOL> main ( args ) </s>
