Mercurial > p > roundup > code
comparison test/test_rest.py @ 5586:8f2fbc88e155 REST-rebased
Fixed code convention
committer: Ralf Schlatterbeck <rsc@runtux.com>
| author | Chau Nguyen <dangchau1991@yahoo.com> |
|---|---|
| date | Wed, 30 Jan 2019 10:26:35 +0100 |
| parents | 8725c09802b8 |
| children | 6b3a9655a7d9 |
comparison
equal
deleted
inserted
replaced
| 5585:8725c09802b8 | 5586:8f2fbc88e155 |
|---|---|
| 1 import unittest, os, shutil, errno, sys, difflib, cgi, re | 1 import unittest |
| 2 | 2 import os |
| 3 from xmlrpclib import MultiCall | 3 import shutil |
| 4 import errno | |
| 5 | |
| 4 from roundup.cgi.exceptions import * | 6 from roundup.cgi.exceptions import * |
| 5 from roundup import init, instance, password, hyperdb, date | 7 from roundup import password, hyperdb |
| 6 from roundup.rest import RestfulInstance | 8 from roundup.rest import RestfulInstance |
| 7 from roundup.backends import list_backends | 9 from roundup.backends import list_backends |
| 8 from roundup.hyperdb import String | 10 from roundup.cgi import client |
| 9 from roundup.cgi import TranslationService, client | |
| 10 | 11 |
| 11 import db_test_base | 12 import db_test_base |
| 12 | 13 |
| 13 NEEDS_INSTANCE = 1 | 14 NEEDS_INSTANCE = 1 |
| 15 | |
| 14 | 16 |
| 15 class TestCase(unittest.TestCase): | 17 class TestCase(unittest.TestCase): |
| 16 | 18 |
| 17 backend = None | 19 backend = None |
| 18 | 20 |
| 311 self.assertEqual(code, 200) | 313 self.assertEqual(code, 200) |
| 312 self.assertEqual(results['attributes']['title'], None) | 314 self.assertEqual(results['attributes']['title'], None) |
| 313 self.assertEqual(len(results['attributes']['nosy']), 0) | 315 self.assertEqual(len(results['attributes']['nosy']), 0) |
| 314 self.assertEqual(results['attributes']['nosy'], []) | 316 self.assertEqual(results['attributes']['nosy'], []) |
| 315 | 317 |
| 318 | |
| 316 def test_suite(): | 319 def test_suite(): |
| 317 suite = unittest.TestSuite() | 320 suite = unittest.TestSuite() |
| 318 for l in list_backends(): | 321 for l in list_backends(): |
| 319 dct = dict(backend=l) | 322 dct = dict(backend=l) |
| 320 subcls = type(TestCase)('TestCase_%s' % l, (TestCase,), dct) | 323 subcls = type(TestCase)('TestCase_%s' % l, (TestCase,), dct) |
