<s> import os <EOL> from textwrap import dedent <EOL> import pytest <EOL> from django . core import management <EOL> from django . core . management import CommandError <EOL> from django . test import TestCase <EOL> from puente . commands import merge_command <EOL> class TestManageMerge ( TestCase ) : <EOL> def test_help ( self ) : <EOL> try : <EOL> management . call_command ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> except SystemExit : <EOL> pass <EOL> def build_filesystem ( basedir , files ) : <EOL> for path , contents in files . items ( ) : <EOL> path = os . path . abspath ( os . path . join ( basedir , path ) ) <EOL> dirname = os . path . dirname ( path ) <EOL> if not os . path . exists ( dirname ) : <EOL> os . makedirs ( dirname ) <EOL> with open ( path , '<STR_LIT:w>' ) as fp : <EOL> fp . write ( contents ) <EOL> class TestMergecommand : <EOL> def test_basic ( self , tmpdir ) : <EOL> locale_dir = tmpdir . join ( '<STR_LIT>' ) <EOL> build_filesystem ( str ( locale_dir ) , { <EOL> '<STR_LIT>' : dedent ( """<STR_LIT>""" ) , <EOL> } ) <EOL> merge_command ( <EOL> create = True , <EOL> backup = True , <EOL> base_dir = str ( tmpdir ) , <EOL> domain_methods = { <EOL> '<STR_LIT>' : [ <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ] <EOL> } , <EOL> languages = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> ) <EOL> assert locale_dir . join ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) . exists ( ) <EOL> assert locale_dir . join ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) . exists ( ) <EOL> assert locale_dir . join ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) . exists ( ) <EOL> def test_missing_pot_file ( self , tmpdir ) : <EOL> with pytest . raises ( CommandError ) : <EOL> merge_command ( <EOL> create = True , <EOL> backup = True , <EOL> base_dir = str ( tmpdir ) , <EOL> domain_methods = { <EOL> '<STR_LIT>' : [ <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ] <EOL> } , <EOL> languages = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> ) </s>
