Commit 1ca76384 by Steve Strassmann

testing

parent d9381ecc
import os import os, polib
from unittest import TestCase from unittest import TestCase
from datetime import datetime from datetime import datetime, timedelta
import polib
import extract import extract
from execute import SOURCE_MSGS_DIR from execute import SOURCE_MSGS_DIR
# Make sure setup runs only once
SETUP_HAS_RUN = False
class TestExtract(TestCase): class TestExtract(TestCase):
""" """
Tests functionality of i18n/extract.py Tests functionality of i18n/extract.py
...@@ -13,11 +15,21 @@ class TestExtract(TestCase): ...@@ -13,11 +15,21 @@ class TestExtract(TestCase):
generated_files = ('django-partial.po', 'djangojs.po', 'mako.po') generated_files = ('django-partial.po', 'djangojs.po', 'mako.po')
def setUp(self): def setUp(self):
global SETUP_HAS_RUN
# Subtract 1 second to help comparisons with file-modify time succeed, # Subtract 1 second to help comparisons with file-modify time succeed,
# since os.path.getmtime() is not millisecond-accurate # since os.path.getmtime() is not millisecond-accurate
self.start_time = datetime.now() - timedelta(seconds=1) self.start_time = datetime.now() - timedelta(seconds=1)
super(TestExtract, self).setUp()
if not SETUP_HAS_RUN:
self.run_main()
SETUP_HAS_RUN = True
def run_main(self):
# Run extraction script. Warning, this takes 1 minute or more # Run extraction script. Warning, this takes 1 minute or more
print "***********************"
print "***********************"
print "***********************"
extract.main() extract.main()
def get_files (self): def get_files (self):
......
import os import os, string, random
import string
import polib
import random
from unittest import TestCase from unittest import TestCase
from datetime import datetime, timedelta from datetime import datetime, timedelta
import generate import generate
from execute import get_config, messages_dir, SOURCE_MSGS_DIR, SOURCE_LOCALE from execute import get_config, messages_dir, SOURCE_MSGS_DIR, SOURCE_LOCALE
......
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