equal
deleted
inserted
replaced
|
1 from cubicweb.devtools import qunit |
|
2 |
|
3 |
|
4 def js(name): |
|
5 return '/static/js_examples/' + name |
|
6 |
|
7 class QUnitTestCaseTC(qunit.QUnitTestCase): |
|
8 |
|
9 all_js_tests = ( |
|
10 (js('test_simple_success.js'),), |
|
11 (js('test_with_dep.js'), (js('dep_1.js'),)), |
|
12 (js('test_with_ordered_deps.js'), (js('dep_1.js'), js('deps_2.js'),)), |
|
13 ) |
|
14 |
|
15 |
|
16 def test_simple_failure(self): |
|
17 js_tests = list(self._test_qunit(js('test_simple_failure.js'))) |
|
18 self.assertEqual(len(js_tests), 3) |
|
19 test_1, test_2, test_3 = js_tests |
|
20 self.assertRaises(self.failureException, test_1[0], *test_1[1:]) |
|
21 self.assertRaises(self.failureException, test_2[0], *test_2[1:]) |
|
22 test_3[0](*test_3[1:]) |
|
23 |
|
24 |
|
25 if __name__ == '__main__': |
|
26 from unittest import main |
|
27 main() |