from xhpy.init import register_xhpy_module register_xhpy_module('CodeStreak.xhpy.lib') register_xhpy_module('CodeStreak.xhpy.base') register_xhpy_module('CodeStreak.xhpy.contest') from CodeStreak.xhpy.base import * from CodeStreak.xhpy.contest import *
from xhpy.init import register_xhpy_module register_xhpy_module('lightning.ui') register_xhpy_module('lightning.views')
def test_lineno_02(self): register_xhpy_module('lineno_02') from . import lineno_02 self.assertEqual(7, lineno_02.result[1])
def test_pep0263_01(self): register_xhpy_module('pep0263_01') from . import pep0263_01 self.assertEqual('<p>Andr\xe9</p>', str(pep0263_01.result))
def test_class_constants(self): register_xhpy_module('class_constants') from . import class_constants self.assertEqual({'etc': 1, 'bar': 2}, class_constants.result)
def test_docstrings_05(self): register_xhpy_module('docstrings_05') from . import docstrings_05 self.assertEqual('b', docstrings_05.result)
from xhpy.init import register_xhpy_module register_xhpy_module('post') from post import render_post, render_index import codecs import datetime import json import sys import os import os.path def _write_file(html, path): filename = os.path.join(root, path) dirname = os.path.dirname(filename) if not os.path.exists(dirname): os.makedirs(dirname) with codecs.open(filename, mode='w', encoding='utf-8') as f: f.write(html) sys.stdout = codecs.getwriter('UTF-8')(sys.stdout) root = sys.argv[1] posts = [json.loads(line) for line in sys.stdin] posts.sort(key=lambda post: post['order']) for i, data in enumerate(posts): print u'Generating post: {0}'.format(data['title']) data['prev'] = {} data['next'] = {} if i > 0: data['prev'] = posts[i - 1] if i < len(posts) - 1: data['next'] = posts[i + 1]
def test_attr_float(self): register_xhpy_module('attr_float') from . import attr_float self.assertEqual('pass', attr_float.result)
from xhpy.init import register_xhpy_module register_xhpy_module('foo.ui') register_xhpy_module('foo.views')
# set up XHPy system, hook into UI libraries from xhpy.init import register_xhpy_module register_xhpy_module('cv.views') register_xhpy_module('cv.ui') # register signal handlers # TODO: re-enable these. for now, we just want to find out how the # through association looks so that we can use it in the correct manner... #import signal_handlers
def test_pep0263_01(self): register_xhpy_module('pep0263_01') import pep0263_01 self.assertEqual(u'<p>Andr\xe9</p>', unicode(pep0263_01.result))
def test_lineno_01(self): register_xhpy_module('lineno_01') import lineno_01 self.assertEqual(7, lineno_01.result[1])
def test_docstrings_02(self): register_xhpy_module('docstrings_02') import docstrings_02 self.assertEqual('b', docstrings_02.result)
def test_whitespace_07(self): register_xhpy_module('whitespace_07') import whitespace_07 self.assertEqual(u'<a>abc</a>', unicode(whitespace_07.result))
from xhpy.init import register_xhpy_module register_xhpy_module("foo") import foo
def test_attr_entity(self): register_xhpy_module('attr_entity') from . import attr_entity self.assertEqual('pass', attr_entity.result)
def test_stack_balance_fail(self): register_xhpy_module('stack_balance_fail') from . import stack_balance_fail self.assertEqual('pass', stack_balance_fail.result)
def test_attributes(self): register_xhpy_module('attributes') from . import attributes self.assertEqual('pass', attributes.result)
def test_whitespace_04(self): register_xhpy_module('whitespace_04') from . import whitespace_04 self.assertEqual('<a><a></a>a</a>', str(whitespace_04.result))
def test_docstrings_03(self): register_xhpy_module('docstrings_03') from . import docstrings_03 self.assertEqual('c', docstrings_03.result)
def test_whitespace_05(self): register_xhpy_module('whitespace_05') from . import whitespace_05 self.assertEqual('<a>foo</a>', str(whitespace_05.result))
def test_klass(self): register_xhpy_module('klass') from . import klass self.assertEqual('pass', klass.result)
def test_whitespace_07(self): register_xhpy_module('whitespace_07') from . import whitespace_07 self.assertEqual('<a>abc</a>', str(whitespace_07.result))
def test_logical_op(self): register_xhpy_module('logical_op') from . import logical_op self.assertEqual(True, logical_op.result)
def test_xhpy_function_param(self): register_xhpy_module('xhpy_function_param') from . import xhpy_function_param self.assertEqual('pass', xhpy_function_param.result)
from xhpy.init import register_xhpy_module register_xhpy_module('ui') register_xhpy_module('view') import view view.render_list([ "<script>alert('welcome to the jungle')</script>" ])
def test_array_constant(self): register_xhpy_module('array_constant') from . import array_constant self.assertEqual('pass', array_constant.result)
from xhpy.init import register_xhpy_module register_xhpy_module('foo') import foo
def test_attr_blank(self): register_xhpy_module('attr_blank') from . import attr_blank self.assertEqual('pass', attr_blank.result)
from xhpy.init import register_xhpy_module register_xhpy_module('CodeStreak.contests.views')
def test_whitespace_05(self): register_xhpy_module('whitespace_05') import whitespace_05 self.assertEqual(u'<a>foo</a>', unicode(whitespace_05.result))