Commit Graph

13 Commits

Author SHA1 Message Date
David Wilson cbcd8267d1 tests: must decode() zlib result for 3.x. 2018-07-07 14:55:47 +01:00
David Wilson 410016ff47 Initial Python 3.x port work.
* ansible: use unicode_literals everywhere since it only needs to be
  compatible back to 2.6.
* compat/collections.py: delete this entirely and rip out the parts of
  functools that require it.
* Introduce serializable Kwargs dict subclass that translates keys to
  Unicode on instantiation.
* enable_debug_logging() must set _v/_vv globals.
* cStringIO does not exist in 3.x.
* Treat IOLogger and LogForwarder input as latin-1.
* Avoid ResourceWarnings in first stage by explicitly closing fps.
* Fix preamble_size.py syntax errors.
2018-07-07 14:55:47 +01:00
David Wilson 03fcf057dd tests: just call log_to_file() from testlib
Now we can run test.sh with MITOGEN_LOG_LEVEL=debug and things just
work.
2018-03-29 07:25:11 +00:00
David Wilson 23e279b617 tests: get import_test limping back to health. 2018-03-22 05:07:31 +05:45
Alex Willmer 4b373c421b core: Standardise type of Importer.whitelist
This seemed a reasonable streamlining, but I'm happy to be overruled.
2018-03-19 21:58:31 +05:45
Alex Willmer 8338caa419 tests: Add mitogen.core.is_blacklisted_import() tests
These test the current behviour, which may not be exactly the intended
behaviour. Refs #98
2018-03-19 21:58:31 +05:45
Alex Willmer 9ccff0f5d1 Fix TypeError while initiliazing ImporterMixin
Since f44356af32 mitogen.core.Importer()
takes a Router instance.
2018-03-19 21:58:29 +05:45
Alex Willmer 7e01c5bed5 Import and use unittest2 without aliasing it 2018-03-19 21:58:28 +05:45
Alex Willmer e8e023ce59 Use specific TestCase assertions throughout tests
e.g. assert x == y -> self.assertEqual(x, y);
self.assertTrue(isinstance(x, y)) -> self.assertIsInstance(x, y)

These specific methods give more useful errors in the case of a test
failure.
2018-03-19 21:58:28 +05:45
Alex Willmer 17da6e9998 Use unittest2 in all tests
This allows using features such as TestCase,assertIsInstance on Python
2.6 and earlier.
2018-03-19 21:58:27 +05:45
David Wilson d17af194b5 Fix importer_test constructor signature. 2018-03-19 21:35:37 +05:45
David Wilson ced6d8e404 Fix up importer_test. 2018-03-19 21:35:36 +05:45
David Wilson e7ff6259a3 Initial commit. 2018-03-19 21:35:13 +05:45