<s> import subprocess <EOL> import os <EOL> from flask import current_app <EOL> from babel . support import Translations , NullTranslations <EOL> from flaskbb . utils . translations import FlaskBBDomain <EOL> from flaskbb . extensions import plugin_manager <EOL> def _remove_compiled_translations ( ) : <EOL> translations_folder = os . path . join ( current_app . root_path , "<STR_LIT>" ) <EOL> for root , dirs , files in os . walk ( translations_folder ) : <EOL> for name in files : <EOL> if name . endswith ( "<STR_LIT>" ) : <EOL> os . unlink ( os . path . join ( root , name ) ) <EOL> def _compile_translations ( ) : <EOL> PLUGINS_FOLDER = os . path . join ( current_app . root_path , "<STR_LIT>" ) <EOL> translations_folder = os . path . join ( current_app . root_path , "<STR_LIT>" ) <EOL> subprocess . call ( [ "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , translations_folder ] ) <EOL> for plugin in plugin_manager . all_plugins : <EOL> plugin_folder = os . path . join ( PLUGINS_FOLDER , plugin ) <EOL> translations_folder = os . path . join ( plugin_folder , "<STR_LIT>" ) <EOL> subprocess . call ( [ "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , translations_folder ] ) <EOL> def test_flaskbbdomain_translations ( default_settings ) : <EOL> domain = FlaskBBDomain ( current_app ) <EOL> with current_app . test_request_context ( ) : <EOL> assert domain . get_translations_cache ( ) == { } <EOL> _remove_compiled_translations ( ) <EOL> assert isinstance ( domain . get_translations ( ) , NullTranslations ) <EOL> _compile_translations ( ) <EOL> assert isinstance ( domain . get_translations ( ) , Translations ) </s>
