Commit 19e1bc8e authored by Michal Čihař's avatar Michal Čihař

Test more different xliff files

parent a36d102b
......@@ -164,6 +164,18 @@ class RepoTestCase(TestCase):
'xliff/*/DPH.xlf',
)
def create_xliff_resname(self):
return self._create_subproject(
'xliff',
'xliff/*/Resname.xlf',
)
def create_xliff_empty(self):
return self._create_subproject(
'xliff',
'xliff/*/EMPTY.xlf',
)
def create_link(self):
parent = self.create_iphone()
return SubProject.objects.create(
......@@ -275,6 +287,22 @@ class SubProjectTest(RepoTestCase):
translation = project.translation_set.all()[0]
self.assertEqual(translation.unit_set.count(), 9)
def test_create_xliff_empty(self):
project = self.create_xliff_empty()
project.full_clean()
self.assertTrue(os.path.exists(project.get_path()))
self.assertEqual(project.translation_set.count(), 1)
translation = project.translation_set.all()[0]
self.assertEqual(translation.unit_set.count(), 6)
def test_create_xliff_resname(self):
project = self.create_xliff_resname()
project.full_clean()
self.assertTrue(os.path.exists(project.get_path()))
self.assertEqual(project.translation_set.count(), 1)
translation = project.translation_set.all()[0]
self.assertEqual(translation.unit_set.count(), 2)
def test_link(self):
project = self.create_link()
project.full_clean()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment