You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ts...@apache.org on 2012/08/04 14:00:57 UTC

[4/4] Removing pymysql and including it as setup dependency

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/60cd6538/tools/marvin/marvin/pymysql/tests/thirdparty/test_MySQLdb/test_MySQLdb_nonstandard.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/pymysql/tests/thirdparty/test_MySQLdb/test_MySQLdb_nonstandard.py b/tools/marvin/marvin/pymysql/tests/thirdparty/test_MySQLdb/test_MySQLdb_nonstandard.py
deleted file mode 100644
index f49369c..0000000
--- a/tools/marvin/marvin/pymysql/tests/thirdparty/test_MySQLdb/test_MySQLdb_nonstandard.py
+++ /dev/null
@@ -1,90 +0,0 @@
-import unittest
-
-import pymysql
-_mysql = pymysql
-from pymysql.constants import FIELD_TYPE
-from pymysql.tests import base
-
-
-class TestDBAPISet(unittest.TestCase):
-    def test_set_equality(self):
-        self.assertTrue(pymysql.STRING == pymysql.STRING)
-
-    def test_set_inequality(self):
-        self.assertTrue(pymysql.STRING != pymysql.NUMBER)
-
-    def test_set_equality_membership(self):
-        self.assertTrue(FIELD_TYPE.VAR_STRING == pymysql.STRING)
-
-    def test_set_inequality_membership(self):
-        self.assertTrue(FIELD_TYPE.DATE != pymysql.STRING)
-
-
-class CoreModule(unittest.TestCase):
-    """Core _mysql module features."""
-
-    def test_NULL(self):
-        """Should have a NULL constant."""
-        self.assertEqual(_mysql.NULL, 'NULL')
-
-    def test_version(self):
-        """Version information sanity."""
-        self.assertTrue(isinstance(_mysql.__version__, str))
-
-        self.assertTrue(isinstance(_mysql.version_info, tuple))
-        self.assertEqual(len(_mysql.version_info), 5)
-
-    def test_client_info(self):
-        self.assertTrue(isinstance(_mysql.get_client_info(), str))
-
-    def test_thread_safe(self):
-        self.assertTrue(isinstance(_mysql.thread_safe(), int))
-
-
-class CoreAPI(unittest.TestCase):
-    """Test _mysql interaction internals."""
-
-    def setUp(self):
-        kwargs = base.PyMySQLTestCase.databases[0].copy()
-        kwargs["read_default_file"] = "~/.my.cnf"
-        self.conn = _mysql.connect(**kwargs)
-
-    def tearDown(self):
-        self.conn.close()
-
-    def test_thread_id(self):
-        tid = self.conn.thread_id()
-        self.assertTrue(isinstance(tid, int),
-                        "thread_id didn't return an int.")
-
-        self.assertRaises(TypeError, self.conn.thread_id, ('evil',),
-                          "thread_id shouldn't accept arguments.")
-
-    def test_affected_rows(self):
-        self.assertEquals(self.conn.affected_rows(), 0,
-                          "Should return 0 before we do anything.")
-
-
-    #def test_debug(self):
-        ## FIXME Only actually tests if you lack SUPER
-        #self.assertRaises(pymysql.OperationalError,
-                          #self.conn.dump_debug_info)
-
-    def test_charset_name(self):
-        self.assertTrue(isinstance(self.conn.character_set_name(), str),
-                        "Should return a string.")
-
-    def test_host_info(self):
-        self.assertTrue(isinstance(self.conn.get_host_info(), str),
-                        "Should return a string.")
-
-    def test_proto_info(self):
-        self.assertTrue(isinstance(self.conn.get_proto_info(), int),
-                        "Should return an int.")
-
-    def test_server_info(self):
-        self.assertTrue(isinstance(self.conn.get_server_info(), basestring),
-                        "Should return an str.")
-
-if __name__ == "__main__":
-    unittest.main()

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/60cd6538/tools/marvin/marvin/pymysql/times.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/pymysql/times.py b/tools/marvin/marvin/pymysql/times.py
deleted file mode 100644
index c47db09..0000000
--- a/tools/marvin/marvin/pymysql/times.py
+++ /dev/null
@@ -1,16 +0,0 @@
-from time import localtime
-from datetime import date, datetime, time, timedelta
-
-Date = date
-Time = time
-TimeDelta = timedelta
-Timestamp = datetime
-
-def DateFromTicks(ticks):
-    return date(*localtime(ticks)[:3])
-
-def TimeFromTicks(ticks):
-    return time(*localtime(ticks)[3:6])
-
-def TimestampFromTicks(ticks):
-    return datetime(*localtime(ticks)[:6])

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/60cd6538/tools/marvin/marvin/pymysql/util.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/pymysql/util.py b/tools/marvin/marvin/pymysql/util.py
deleted file mode 100644
index cc622e5..0000000
--- a/tools/marvin/marvin/pymysql/util.py
+++ /dev/null
@@ -1,19 +0,0 @@
-import struct
-
-def byte2int(b):
-    if isinstance(b, int):
-        return b
-    else:
-        return struct.unpack("!B", b)[0]
-
-def int2byte(i):
-    return struct.pack("!B", i)
-
-def join_bytes(bs):
-    if len(bs) == 0:
-        return ""
-    else:
-        rv = bs[0]
-        for b in bs[1:]:
-            rv += b
-        return rv

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/60cd6538/tools/marvin/setup.py
----------------------------------------------------------------------
diff --git a/tools/marvin/setup.py b/tools/marvin/setup.py
index 96981ee..c9841f3 100644
--- a/tools/marvin/setup.py
+++ b/tools/marvin/setup.py
@@ -34,9 +34,10 @@ setup(name="Marvin",
       long_description="Marvin is the cloudstack testclient written around the python unittest framework",
       platforms=("Any",),
       url="http://jenkins.cloudstack.org:8080/job/marvin",
-      packages=["marvin", "marvin.cloudstackAPI", "marvin.sandbox", "marvin.sandbox.advanced", "marvin.sandbox.basic", "marvin.pymysql", "marvin.pymysql.constants", "marvin.pymysql.tests"],
+      packages=["marvin", "marvin.cloudstackAPI", "marvin.sandbox", "marvin.sandbox.advanced", "marvin.sandbox.basic"],
       license="LICENSE.txt",
       install_requires=[
+          "pymysql",
           "paramiko",
           "nose",
           "unittest-xml-reporting"