Commit 09693c80 authored by Michal Čihař's avatar Michal Čihař

Simplify creating of test projects

parent c9399b67
......@@ -92,10 +92,10 @@ class RepoTestCase(TestCase):
web='http://weblate.org/'
)
def create_subproject(self, file_format='auto', mask='po/*.po',
def _create_subproject(self, file_format='auto', mask='po/*.po',
template='', repoweb=REPOWEB_URL):
'''
Creates test subproject.
Creates real test subproject.
'''
project = self.create_project()
return SubProject.objects.create(
......@@ -110,28 +110,37 @@ class RepoTestCase(TestCase):
repoweb=repoweb,
)
def create_subproject(self):
'''
Wrapper method for proving test subproject.
'''
return self._create_subproject(
'auto',
'po/*.po',
)
def create_iphone(self):
return self.create_subproject(
return self._create_subproject(
'strings',
'iphone/*.lproj/Localizable.strings',
)
def create_android(self):
return self.create_subproject(
return self._create_subproject(
'aresource',
'android/values-*/strings.xml',
'android/values/strings.xml',
)
def create_java(self):
return self.create_subproject(
return self._create_subproject(
'properties',
'java/swing_messages_*.properties',
'java/swing_messages.properties',
)
def create_xliff(self):
return self.create_subproject(
return self._create_subproject(
'xliff',
'xliff/*/DPH.xlf',
)
......
......@@ -136,12 +136,12 @@ class BasicViewTest(ViewTestCase):
class BasicResourceViewTest(BasicViewTest):
def create_subproject(self, *args, **kwargs):
def create_subproject(self):
return self.create_android()
class BasicIphoneViewTest(BasicViewTest):
def create_subproject(self, *args, **kwargs):
def create_subproject(self):
return self.create_iphone()
......@@ -222,10 +222,10 @@ class EditTest(ViewTestCase):
class EditResourceTest(EditTest):
def create_subproject(self, *args, **kwargs):
def create_subproject(self):
return self.create_android()
class EditIphoneTest(EditTest):
def create_subproject(self, *args, **kwargs):
def create_subproject(self):
return self.create_iphone()
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