<s> from dcos import util <EOL> from dcos . errors import DCOSException <EOL> import pytest <EOL> def test_render_mustache_json ( ) : <EOL> template = '<STR_LIT>' <EOL> xs = [ <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> ] <EOL> ys = { '<STR_LIT>' : <NUM_LIT:1> , '<STR_LIT>' : <NUM_LIT:2> } <EOL> z = '<STR_LIT:abc>' <EOL> data = { '<STR_LIT>' : xs , '<STR_LIT>' : ys , '<STR_LIT:z>' : z } <EOL> result = util . render_mustache_json ( template , data ) <EOL> assert type ( result ) is dict <EOL> assert result . get ( '<STR_LIT:x>' ) == xs <EOL> assert result . get ( '<STR_LIT:y>' ) == ys <EOL> assert result . get ( '<STR_LIT:z>' ) == z <EOL> def test_open_file ( ) : <EOL> path = '<STR_LIT>' <EOL> with pytest . raises ( DCOSException ) as excinfo : <EOL> with util . open_file ( path ) : <EOL> pass <EOL> assert '<STR_LIT>' . format ( path ) in str ( excinfo . value ) </s>
