Exemplo n.º 1
0
 def test_lang_code(self):
     subproject = SubProject()
     subproject.filemask = 'Solution/Project/Resources.*.resx'
     self.assertEqual(
         subproject.get_lang_code('Solution/Project/Resources.es-mx.resx'),
         'es-mx'
     )
     self.assertEqual(
         subproject.get_lang_code('Solution/Project/Resources.resx'),
         ''
     )
     self.assertRaisesMessage(
         ValidationError,
         'Got empty language code for '
         'Solution/Project/Resources.resx, please check filemask!',
         subproject.clean_lang_codes,
         [
             'Solution/Project/Resources.resx',
             'Solution/Project/Resources.de.resx',
             'Solution/Project/Resources.es.resx',
             'Solution/Project/Resources.es-mx.resx',
             'Solution/Project/Resources.fr.resx',
             'Solution/Project/Resources.fr-fr.resx',
         ]
     )
Exemplo n.º 2
0
 def test_lang_code(self):
     subproject = SubProject()
     subproject.filemask = 'Solution/Project/Resources.*.resx'
     self.assertEqual(
         subproject.get_lang_code('Solution/Project/Resources.es-mx.resx'),
         'es-mx'
     )
     self.assertEqual(
         subproject.get_lang_code('Solution/Project/Resources.resx'),
         ''
     )
     self.assertRaisesMessage(
         ValidationError,
         'Got empty language code for '
         'Solution/Project/Resources.resx, please check filemask!',
         subproject.clean_lang_codes,
         [
             'Solution/Project/Resources.resx',
             'Solution/Project/Resources.de.resx',
             'Solution/Project/Resources.es.resx',
             'Solution/Project/Resources.es-mx.resx',
             'Solution/Project/Resources.fr.resx',
             'Solution/Project/Resources.fr-fr.resx',
         ]
     )
Exemplo n.º 3
0
 def test_lang_code_double(self):
     subproject = SubProject()
     subproject.filemask = 'path/*/resources/MessagesBundle_*.properties'
     self.assertEqual(
         subproject.get_lang_code(
             'path/pt/resources/MessagesBundle_pt_BR.properties'), 'pt_BR')
     self.assertEqual(
         subproject.get_lang_code(
             'path/el/resources/MessagesBundle_el.properties'), 'el')
Exemplo n.º 4
0
 def test_lang_code_double(self):
     subproject = SubProject()
     subproject.filemask = 'path/*/resources/MessagesBundle_*.properties'
     self.assertEqual(
         subproject.get_lang_code(
             'path/pt/resources/MessagesBundle_pt_BR.properties'
         ),
         'pt_BR'
     )
     self.assertEqual(
         subproject.get_lang_code(
             'path/el/resources/MessagesBundle_el.properties'
         ),
         'el'
     )
Exemplo n.º 5
0
 def test_lang_code_template(self):
     subproject = SubProject(project=Project())
     subproject.filemask = 'Solution/Project/Resources.*.resx'
     subproject.template = 'Solution/Project/Resources.resx'
     self.assertEqual(
         subproject.get_lang_code('Solution/Project/Resources.resx'),
         'en'
     )
Exemplo n.º 6
0
 def test_lang_code_template(self):
     subproject = SubProject(project=Project())
     subproject.filemask = 'Solution/Project/Resources.*.resx'
     subproject.template = 'Solution/Project/Resources.resx'
     self.assertEqual(
         subproject.get_lang_code('Solution/Project/Resources.resx'),
         'en'
     )
Exemplo n.º 7
0
 def test_lang_code(self):
     subproject = SubProject()
     subproject.filemask = "Solution/Project/Resources.*.resx"
     self.assertEqual(subproject.get_lang_code("Solution/Project/Resources.es-mx.resx"), "es-mx")
     self.assertEqual(subproject.get_lang_code("Solution/Project/Resources.resx"), "")
     self.assertRaisesMessage(
         ValidationError,
         "Got empty language code for " "Solution/Project/Resources.resx, please check filemask!",
         subproject.clean_lang_codes,
         [
             "Solution/Project/Resources.resx",
             "Solution/Project/Resources.de.resx",
             "Solution/Project/Resources.es.resx",
             "Solution/Project/Resources.es-mx.resx",
             "Solution/Project/Resources.fr.resx",
             "Solution/Project/Resources.fr-fr.resx",
         ],
     )
Exemplo n.º 8
0
 def test_lang_code_template(self):
     subproject = SubProject()
     subproject.filemask = "Solution/Project/Resources.*.resx"
     subproject.template = "Solution/Project/Resources.resx"
     self.assertEqual(subproject.get_lang_code("Solution/Project/Resources.resx"), "en")