def test_get_server_info(self):
        cmy = MySQL()
        self.assertRaises(MySQLInterfaceError, cmy.get_server_info)

        cmy.connect(**self.connect_kwargs)
        version = cmy.get_server_version()
        info = cmy.get_server_info()
        self.assertIsInstance(info, str)
        self.assertTrue(info.startswith('.'.join([str(v) for v in version])))
Example #2
0
    def test_get_server_info(self):
        cmy = MySQL()
        self.assertRaises(MySQLInterfaceError, cmy.get_server_info)

        cmy.connect(**self.connect_kwargs)
        version = cmy.get_server_version()
        info = cmy.get_server_info()
        self.assertIsInstance(info, str)
        self.assertTrue(info.startswith('.'.join([str(v) for v in version])))
    def test_get_server_version(self):
        cmy = MySQL()
        self.assertRaises(MySQLInterfaceError, cmy.get_server_version)

        cmy.connect(**self.connect_kwargs)
        version = cmy.get_server_version()
        self.assertIsInstance(version, tuple)
        self.assertEqual(3, len(version))
        self.assertTrue(all([isinstance(v, int) and v > 0 for v in version]))

        self.assertTrue(3 < version[0] < 7)
        self.assertTrue(0 < version[1] < 20)
        self.assertTrue(0 < version[2] < 99)
Example #4
0
    def test_get_server_version(self):
        cmy = MySQL()
        self.assertRaises(MySQLInterfaceError, cmy.get_server_version)

        cmy.connect(**self.connect_kwargs)
        version = cmy.get_server_version()
        self.assertIsInstance(version, tuple)
        self.assertEqual(3, len(version))
        self.assertTrue(all([isinstance(v, int) for v in version]))

        self.assertTrue(3 < version[0] < 9)
        self.assertTrue(0 <= version[1] < 20)
        self.assertTrue(0 < version[2] < 99)