def test_check_yajl_version_warnsOnlyWhenMismatchedVersions(self): import warnings self.mock('warnings.warn') self.mock('yajl.__version__', mock_obj='1.1.1') self.mock('yajl.yajl_version', mock_obj='1.1.1') self.assertTrue(yajl.check_yajl_version()) self.assertSameTrace('') self.mock('yajl.yajl_version', mock_obj='1.1.0') self.assertFalse(yajl.check_yajl_version()) self.assertSameTrace( "Called warnings.warn(" "'Using Yajl-Py v1.1.1 with Yajl v1.1.0. " "It is advised to use the same Yajl-Py and Yajl versions'," "<type 'exceptions.RuntimeWarning'>, stacklevel=3)" )
def test_checkYajlPyAndYajlHaveSameVersion(self): self.assertTrue(yajl.check_yajl_version())