Esempio n. 1
0
def test_t46():
    with pytest.raises(Exception) as e:
        args = {
            'connection_info': {
                "type": "mysql",
                "host": "localhost",
                "namespace": "testtest",
                "user": "******",
                "password": "******",
                "port": 3306
            },
            "tablename":
            "test_all_datatypes",
            "update_fields": ["id", "name"],
            "limit":
            "5",
            "offset":
            20,
            "order_by":
            "id",
            "filter": [{
                "operand": "id",
                "operator": ">",
                "value": 10
            }, {
                "operand": "is_active",
                "operator": "=",
                "value": True
            }]
        }
        datastorex.update(args)
Esempio n. 2
0
def test_t64():
    with pytest.raises(Exception) as e:
        args = {
            'connection_info': {
                "type": "mysql",
                "host": "localhost",
                "namespace": "testtest",
                "user": "******",
                "password": "******",
                "port": 3306
            },
            "tablename":
            "test_all_datatypes",
            "update_fields": ["id", "name", "dob"],
            "limit":
            "5",
            "offset":
            20,
            "order_by":
            "id",
            "filter": [{
                "operand": "dob",
                "operator": "not in",
                "value": ["2016-02-01", "2016-02-09 23:59:59"]
            }]
        }
        datastorex.update(args)
Esempio n. 3
0
def test_t36():
    with pytest.raises(Exception) as e:
        args = {
            'connection_info': {
                "type": "mysql",
                "host": "localhost",
                "namespace": "testtest",
                "user": "******",
                "password": "******",
                "port": 3306
            },
            "tablename":
            "test_all_datatypes",
            "update_fields": ["id", "name"],
            "limit":
            "5",
            "offset":
            20,
            "order_by":
            "id",
            "filter": [{
                "operand": "height",
                "operator": "not in",
                "value": [10.23, 11, 12.45, 1, -89]
            }]
        }
        datastorex.update(args)
Esempio n. 4
0
def test_t7():
    with pytest.raises(Exception) as e:
        args = {
            'connection_info': {
                "type": "mysql",
                "host": "localhost",
                "namespace": "freedata",
                "user": "******",
                "password": "******",
                "port": "1234"
            }
        }
        datastorex.update(args)
Esempio n. 5
0
def test_t10():
    with pytest.raises(Exception) as e:
        args = {
            'connection_info': {
                "type": "mysql",
                "host": "localhost",
                "namespace": "testtest",
                "user": "******",
                "password": "******",
                "port": 3306
            },
            "tablename": "ohhlala"
        }
        datastorex.update(args)
Esempio n. 6
0
def test_t9():
    with pytest.raises(Exception) as e:
        args = {
            'connection_info': {
                "type": "sqlite",
                "host": "localhost",
                "namespace": "freedata",
                "user": "******",
                "password": "******",
                "port": "1234"
            },
            "tablename": "ohhlala"
        }
        datastorex.update(args)
Esempio n. 7
0
def test_t16():
    with pytest.raises(Exception) as e:
        args = {
            'connection_info': {
                "type": "mysql",
                "host": "localhost",
                "namespace": "testtest",
                "user": "******",
                "password": "******",
                "port": 3306
            },
            "tablename": "test_all_datatypes",
            "set_columns": ["", ""]
        }
        datastorex.update(args)
Esempio n. 8
0
def test_t19():
    with pytest.raises(Exception) as e:
        args = {
            'connection_info': {
                "type": "mysql",
                "host": "localhost",
                "namespace": "testtest",
                "user": "******",
                "password": "******",
                "port": 3306
            },
            "tablename": "test_all_datatypes",
            "update_fields": ["dob_tz"],
            "limit": "10"
        }
        datastorex.update(args)
Esempio n. 9
0
def test_t22():
    with pytest.raises(Exception) as e:
        args = {
            'connection_info': {
                "type": "mysql",
                "host": "localhost",
                "namespace": "testtest",
                "user": "******",
                "password": "******",
                "port": 3306
            },
            "tablename": "test_all_datatypes",
            "update_fields":
            ["id", "name", "height", "is_active", "dob", "dob_tz"],
            "limit": "5",
            "offset": 20,
            "order_by": "id desc"
        }
        datastorex.update(args)
Esempio n. 10
0
def test_t13():
    with pytest.raises(Exception) as e:
        args = {
            'connection_info': {
                "type": "mysql",
                "host": "localhost",
                "namespace": "testtest",
                "user": "******",
                "password": "******",
                "port": 3306
            },
            "tablename":
            "yoooo",
            "set_columns": ["attr1"],
            "set_values": [
                "hello world %s" %
                datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
            ]
        }
        datastorex.update(args)
Esempio n. 11
0
def test_t18():
    args = {
        'connection_info': {
            "type": "mysql",
            "host": "localhost",
            "namespace": "testtest",
            "user": "******",
            "password": "******",
            "port": 3306
        },
        "tablename":
        "test_all_datatypes",
        "set_columns": ["name"],
        "set_values": [
            "hello world %s" %
            datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
        ],
        "filter": [{
            "operand": "id",
            "operator": "!=",
            "value": 23
        }]
    }
    datastorex.update(args)
Esempio n. 12
0
def test_t1():
    with pytest.raises(Exception) as e:
        datastorex.update()
Esempio n. 13
0
def test_t6():
    with pytest.raises(Exception) as e:
        args = {'connection_info': {"type": "mysql"}}
        datastorex.update(args)
Esempio n. 14
0
def test_t5():
    with pytest.raises(Exception) as e:
        args = {'connection_info': {"tablename": "yoooo"}}
        datastorex.update(args)
Esempio n. 15
0
def test_t4():
    with pytest.raises(Exception) as e:
        args = {'connection_info': {}}
        datastorex.update(args)
Esempio n. 16
0
def test_t3():
    with pytest.raises(Exception) as e:
        args = {}
        datastorex.update(args)