+ assert result_set == {'us': set(('us', 'us1', 'us2', 'United States')),
+ 'fr': set(('fr', 'Fra', 'Fren'))}
+
+
+def test_setup_country_config_languages_not_loaded(project_env):
+ (project_env.project_dir / 'country_settings.yaml').write_text("""
+de:
+ partition: 3
+ names:
+ name:
+ default: Deutschland
+""")
+ country_info._COUNTRY_INFO._info = None
+ country_info.setup_country_config(project_env)
+ assert country_info._COUNTRY_INFO._info == {'de': {'partition': 3,
+ 'languages': [], 'names': {'name': {'default': 'Deutschland'}}}}
+
+
+def test_setup_country_config_name_not_loaded(project_env):
+ (project_env.project_dir / 'country_settings.yaml').write_text("""
+de:
+ partition: 3
+ languages: de
+ names:
+""")
+ country_info._COUNTRY_INFO._info = None
+ country_info.setup_country_config(project_env)
+ assert country_info._COUNTRY_INFO._info == {'de': {'partition': 3,
+ 'languages': ['de'], 'names': {'name': {}}}}
+
+
+def test_setup_country_config_names_not_loaded(project_env):
+ (project_env.project_dir / 'country_settings.yaml').write_text("""
+de:
+ partition: 3
+ languages: de
+""")
+ country_info._COUNTRY_INFO._info = None
+ country_info.setup_country_config(project_env)
+ assert country_info._COUNTRY_INFO._info == {'de': {'partition': 3,
+ 'languages': ['de'], 'names': {'name': {}}}}
+
+
+def test_setup_country_config_special_character(project_env):
+ (project_env.project_dir / 'country_settings.yaml').write_text("""
+bq:
+ partition: 250
+ languages: nl
+ names:
+ name:
+ default: "\\N"
+""")
+ country_info._COUNTRY_INFO._info = None
+ country_info.setup_country_config(project_env)
+ assert country_info._COUNTRY_INFO._info == {'bq': {'partition': 250,
+ 'languages': ['nl'], 'names': {'name': {'default': '\x85'}}}}