Exemplo n.º 1
0
 def get_data():
     data = [
         {'id': 'bill', 'age': 35, 'score': 78},
         {'id': 'joe', 'age': 26, 'score': 60},
         {'id': 'todd', 'age': 52, 'score': 15}
     ]
     return as_db_and_table('y', 'scores', data)
Exemplo n.º 2
0
 def get_data():
     data = [
         {
             'id': 'joe',
             'age': 26,
             'hobbies': ['sand', 'water', 'cats']
         },
         {
             'id': 'bill',
             'age': 52,
             'hobbies': ['watermelon']
         },
         {
             'id': 'todd',
             'age': 35,
             'hobbies': ['citrus'],
             'nums': [100, 550, 40, 900, 800],
             'nums2': [
                 {'val': 26},
                 {'val': 17},
                 {'val': 86}
             ]
         }
     ]
     return as_db_and_table('x', 'people', data)
Exemplo n.º 3
0
 def get_data():
     data = [
         {'id': 'bob', 'first_name': 'Bob', 'last_name': 'Builder'},
         {'id': 'joe', 'first_name': 'Joseph', 'last_name': 'Smith'},
         {'id': 'tom', 'first_name': 'Tom', 'last_name': 'Generic'}
     ]
     return as_db_and_table('s', 'people', data)
Exemplo n.º 4
0
 def get_data():
     data = [{
         'id': 'a-id',
         'name': 'a',
         'parent': None,
         'parents': []
     }, {
         'id': 'b-id',
         'name': 'b',
         'parent': 'a-id',
         'parents': ['a-id']
     }, {
         'id': 'c-id',
         'name': 'c',
         'parent': 'a-id',
         'parents': ['a-id']
     }, {
         'id': 'd-id',
         'name': 'd',
         'parent': 'c-id',
         'parents': ['c-id', 'a-id']
     }, {
         'id': 'e-id',
         'name': 'e',
         'parent': 'b-id',
         'parents': ['b-id', 'a-id']
     }]
     return as_db_and_table('s', 'spaces', data)
Exemplo n.º 5
0
 def get_data():
     data = [
         {'id': 'bob-id', 'age': 32, 'nums': [5, 7]},
         {'id': 'sam-id', 'age': 45},
         {'id': 'joe-id', 'age': 36}
     ]
     return as_db_and_table('d', 'people', data)
Exemplo n.º 6
0
 def get_data():
     data = [
         {'id': 'joe', 'type': 'bro'},
         {'id': 'bill', 'type': 'hipster'},
         {'id': 'todd', 'type': 'hipster'}
     ]
     return as_db_and_table('x', 'people', data)
Exemplo n.º 7
0
 def get_data():
     data = [
         {'id': 'bob-id', 'first_name': 'Bob', 'last_name': 'Sanders', 'age': 35},
         {'id': 'sam-id', 'first_name': 'Sam', 'last_name': 'Fudd', 'age': 17},
         {'id': 'joe-id', 'first_name': 'Joe', 'last_name': 'Sanders', 'age': 62}
     ]
     return as_db_and_table('d', 'people', data)
Exemplo n.º 8
0
 def get_data():
     data = [
         {'id': 'a', 'text': 'something  with spaces'},
         {'id': 'b', 'text': 'some,csv,file'},
         {'id': 'c', 'text': 'someething'}
     ]
     return as_db_and_table('library', 'texts', data)
Exemplo n.º 9
0
 def get_data():
     data = [
         {'id': 'one', 'data': range(10, 20)},
         {'id': 'two', 'data': range(20, 30)},
         {'id': 'three', 'data': range(30, 40)}
     ]
     return as_db_and_table('db', 'things', data)
Exemplo n.º 10
0
 def get_data():
     data = [{
         'id':
         'joe',
         'last_updated':
         datetime.datetime(2014,
                           6,
                           3,
                           0,
                           0,
                           1,
                           tzinfo=r.make_timezone('00:00'))
     }, {
         'id':
         'sam',
         'last_updated':
         datetime.datetime(2014,
                           8,
                           25,
                           0,
                           0,
                           0,
                           tzinfo=r.make_timezone('00:00'))
     }]
     return as_db_and_table('d', 'people', data)
Exemplo n.º 11
0
 def get_data():
     data = [
         {
             'id': 'say_anything'
         },
     ]
     return as_db_and_table('unimportant', 'very', data)
Exemplo n.º 12
0
 def get_data():
     data = [
         {'id': 'one', 'value': 5},
         {'id': 'three', 'value': 22},
         {'id': 'two', 'value': 12},
         {'id': 'four', 'value': 31}
     ]
     return as_db_and_table('x', 't', data)
Exemplo n.º 13
0
 def get_data():
     data = [
         {'id': 'sam-id', 'name': 'sam'},
         {'id': 'anne-id', 'name': 'anne'},
         {'id': 'joe-id', 'name': 'joe'},
         {'id': 'bob-id', 'name': 'bob'}
     ]
     return as_db_and_table('x', 'people', data)
Exemplo n.º 14
0
 def get_data():
     data = [
         {'id': 'joe', 'has_eyes': True, 'age': 22, 'hair_color': 'brown'},
         {'id': 'sam', 'has_eyes': True, 'age': 17, 'hair_color': 'bald'},
         {'id': 'angela', 'has_eyes': False, 'age': 26, 'hair_color': 'black'},
         {'id': 'johnson', 'has_eyes': False, 'age': 16, 'hair_color': 'blonde'}
     ]
     return as_db_and_table('pdb', 'p', data)
Exemplo n.º 15
0
 def get_data():
     data = [
         {'id': 'joe-id', 'name': 'joe', 'age': 28},
         {'id': 'bob-id', 'name': 'bob', 'age': 19},
         {'id': 'bill-id', 'name': 'bill', 'age': 35},
         {'id': 'kimye-id', 'name': 'kimye', 'age': 17}
     ]
     return as_db_and_table('x', 'people', data)
Exemplo n.º 16
0
 def get_data():
     data = [
         {'id': 'joe-id', 'name': 'joe', 'hobby': 'guitar'},
         {'id': 'bob-id', 'name': 'bob', 'hobby': 'pseudointellectualism'},
         {'id': 'bill-id', 'name': 'bill'},
         {'id': 'kimye-id', 'name': 'kimye', 'hobby': 'being kimye'}
     ]
     return as_db_and_table('x', 'people', data)
Exemplo n.º 17
0
 def get_data():
     data = [
         {'id': 'joe', 'last_updated': rtime.make_time(2014, 6, 3)},
         {'id': 'sam', 'last_updated': rtime.make_time(2014, 7, 25)},
         {'id': 'bob', 'last_updated': rtime.make_time(2014, 6, 17)},
         {'id': 'sam', 'last_updated': rtime.make_time(2014, 5, 1)}
     ]
     return as_db_and_table('d', 'people', data)
Exemplo n.º 18
0
 def get_data():
     things = [
         {'id': 'one', 'letters': ['c', 'c']},
         {'id': 'two', 'letters': ['a', 'b', 'a', ['q', 'q'], 'b']},
         {'id': 'three', 'letters': ['b', 'a', 'b', 'a']},
         {'id': 'four', 'letters': ['c', 'a', 'b', 'a', ['q', 'q']]}
     ]
     return as_db_and_table('scrumptious', 'cake', things)
Exemplo n.º 19
0
 def get_data():
     data = [{
         'id': 1,
         'animals': ['frog', 'cow']
     }, {
         'id': 2,
         'animals': ['horse']
     }]
     return as_db_and_table('x', 'farms', data)
Exemplo n.º 20
0
 def get_data():
     data = [{
         'id': 'joe-id',
         'name': 'joe'
     }, {
         'id': 'bob-id',
         'name': 'bob'
     }]
     return as_db_and_table('x', 'people', data)
Exemplo n.º 21
0
    def get_data():
        people = [
            {'id': 'joe', 'first_name': 'Joe', 'age': 26},
            {'id': 'todd', 'first_name': 'Todd', 'last_name': 'Last', 'age': 35},
            {'id': 'phil', 'first_name': 'Phil', 'last_name': 'LastPhil'},
            {'id': 'sam', 'first_name': 'Sam', 'last_name': 'SamLast', 'age': 31}

        ]
        return as_db_and_table('x', 'people', people)
Exemplo n.º 22
0
 def get_data():
     data = [{
         'id': 'joe',
         'last_updated': r.time(2014, 6, 3, 'Z')
     }, {
         'id': 'sam',
         'last_updated': r.time(2014, 8, 25, 'Z')
     }]
     return as_db_and_table('d', 'people', data)
Exemplo n.º 23
0
 def get_data():
     data = [
         {'id': 'one', 'points': 10},
         {'id': 'two', 'points': 25},
         {'id': 'three', 'points': 100},
         {'id': 'four', 'points': 50},
         {'id': 'five', 'points': 6}
     ]
     return as_db_and_table('d', 'nums', data)
Exemplo n.º 24
0
 def get_data():
     data = [
         {'id': 'a-id', 'name': 'a', 'parent': None, 'parents': []},
         {'id': 'b-id', 'name': 'b', 'parent': 'a-id', 'parents': ['a-id']},
         {'id': 'c-id', 'name': 'c', 'parent': 'a-id', 'parents': ['a-id']},
         {'id': 'd-id', 'name': 'd', 'parent': 'c-id', 'parents': ['c-id', 'a-id']},
         {'id': 'e-id', 'name': 'e', 'parent': 'b-id', 'parents': ['b-id', 'a-id']}
     ]
     return as_db_and_table('s', 'spaces', data)
Exemplo n.º 25
0
 def get_data():
     data = [{
         'id': 'joe',
         'last_updated': rtime.make_time(2014, 6, 3, 12, 10, 32)
     }, {
         'id': 'sam',
         'last_updated': rtime.make_time(2014, 8, 25, 17, 3, 54)
     }]
     return as_db_and_table('d', 'people', data)
Exemplo n.º 26
0
 def get_data():
     data = [{
         'id': 'id-1',
         'things': []
     }, {
         'id': 'id-2',
         'things': ['x', 'y']
     }]
     return as_db_and_table('some_db', 'some_table', data)
 def get_data():
     data = [{
         'id': 'kermit-id',
         'species': 'frog',
         'name': 'Kermit'
     }, {
         'id': 'piggy-id',
         'species': 'pig',
         'name': 'Ms. Piggy'
     }]
     return as_db_and_table('things', 'muppets', data)
Exemplo n.º 28
0
 def get_data():
     data = [{
         'id': 'one',
         'data': range(10, 20)
     }, {
         'id': 'two',
         'data': range(20, 30)
     }, {
         'id': 'three',
         'data': range(30, 40)
     }]
     return as_db_and_table('db', 'things', data)
Exemplo n.º 29
0
 def get_data():
     data = [{
         'id': 'bob-id',
         'age': 32,
         'nums': [5, 7]
     }, {
         'id': 'sam-id',
         'age': 45
     }, {
         'id': 'joe-id',
         'age': 36
     }]
     return as_db_and_table('d', 'people', data)
Exemplo n.º 30
0
 def get_data():
     data = [
         {
             'id': 'one',
             'null_attr': None,
             'list_attr': [5],
             'dict_attr': {'x': 10},
             'bool_attr': True,
             'num_attr': 3.2,
             'str_attr': 'text'
         }
     ]
     return as_db_and_table('a_db', 'types', data)
Exemplo n.º 31
0
 def get_data():
     data = [
         {
             'id': 'pt-1',
             'x': 10,
             'y': 25
         },
         {
             'id': 'pt-2',
             'x': 100,
             'y': 3
         }
     ]
     return as_db_and_table('math_db', 'points', data)
Exemplo n.º 32
0
 def get_data():
     data = [
         {
             'id': 'one',
             'simple': ['x', 'y'],
             'complex': [{'val': 10}, {'val': 16}]
         },
         {
             'id': 'two',
             'simple': ['x', 'z'],
             'complex': [{'val': 10}]
         }
     ]
     return as_db_and_table('z', 't', data)
Exemplo n.º 33
0
 def get_data():
     data = [{
         'id': 'one',
         'name': 'One',
         'pets': ['dog', 'cat', 'bird']
     }, {
         'id': 'two',
         'name': 'Two',
         'pets': ['fish', 'another fish']
     }, {
         'id': 'three',
         'name': 'Three',
         'pets': ['toad', 'rabbit']
     }]
     return as_db_and_table('generic', 'table', data)
Exemplo n.º 34
0
 def get_data():
     things = [{
         'id': 'one',
         'letters': ['c', 'c']
     }, {
         'id': 'two',
         'letters': ['a', 'b', 'a', ['q', 'q'], 'b']
     }, {
         'id': 'three',
         'letters': ['b', 'a', 'b', 'a']
     }, {
         'id': 'four',
         'letters': ['c', 'a', 'b', 'a', ['q', 'q']]
     }]
     return as_db_and_table('scrumptious', 'cake', things)
 def get_data():
     data = [{
         'id': 'sam-id',
         'name': 'sam'
     }, {
         'id': 'joe-id',
         'name': 'joe'
     }, {
         'id': 'tom-id',
         'name': 'tom'
     }, {
         'id': 'sally-id',
         'name': 'sally'
     }]
     return as_db_and_table('ephemeral', 'people', data)
Exemplo n.º 36
0
 def get_data():
     data = [{
         'id': 'joe',
         'last_updated': rtime.make_time(2014, 6, 3)
     }, {
         'id': 'sam',
         'last_updated': rtime.make_time(2014, 7, 25)
     }, {
         'id': 'bob',
         'last_updated': rtime.make_time(2014, 6, 17)
     }, {
         'id': 'sam',
         'last_updated': rtime.make_time(2014, 5, 1)
     }]
     return as_db_and_table('d', 'people', data)
Exemplo n.º 37
0
 def get_data():
     data = [{
         'id': 'one',
         'value': 5
     }, {
         'id': 'three',
         'value': 22
     }, {
         'id': 'two',
         'value': 12
     }, {
         'id': 'four',
         'value': 31
     }]
     return as_db_and_table('x', 't', data)
Exemplo n.º 38
0
 def get_data():
     data = [{
         'id': 'bob',
         'first_name': 'Bob',
         'last_name': 'Builder'
     }, {
         'id': 'joe',
         'first_name': 'Joseph',
         'last_name': 'Smith'
     }, {
         'id': 'tom',
         'first_name': 'Tom',
         'last_name': 'Generic'
     }]
     return as_db_and_table('s', 'people', data)
Exemplo n.º 39
0
 def get_data():
     data = [
         {
             'id': 'pt-1',
             'x': 30,
             'y': 3,
             'z': 18
         },
         {
             'id': 'pt-2',
             'x': 24,
             'y': 6,
             'z': 10
         }
     ]
     return as_db_and_table('math_db', 'points', data)
Exemplo n.º 40
0
def conn_sess(request):
    cfg = request.config
    conn_type = cfg.getvalue("conn_type")
    if conn_type == "rethink":
        try:
            server = rethink_server_sess(request)
            conn = server.conn
        except rethinkdb.errors.ReqlDriverError:
            pytest.exit("Unable to connect to rethink")
        except OSError:
            pytest.exit("No rethinkdb binary found")
    elif conn_type == "mockthink":
        conn = MockThink(as_db_and_table('nothing', 'nothing', [])).get_conn()
    else:
        pytest.exit("Unknown mockthink test connection type: " + conn_type)
    return conn
Exemplo n.º 41
0
def conn_sess(request):
    cfg = request.config
    conn_type = cfg.getvalue("conn_type")
    if conn_type == "rethink":
        try:
            server = rethink_server_sess(request)
            conn = server.conn
        except rethinkdb.errors.ReqlDriverError:
            pytest.exit("Unable to connect to rethink")
        except OSError:
            pytest.exit("No rethinkdb binary found")
    elif conn_type == "mockthink":
        conn = MockThink(as_db_and_table('nothing', 'nothing', [])).get_conn()
    else:
        pytest.exit("Unknown mockthink test connection type: " + conn_type)
    return conn
Exemplo n.º 42
0
 def get_data():
     data = [{
         'id': 'joe',
         'attributes': {
             'face': 'bad',
             'toes': 'fugly'
         },
         'joe-attr': True
     }, {
         'id': 'sam',
         'attributes': {
             'face': 'eh',
             'blog': 'dry'
         },
         'sam-attr': True
     }]
     return as_db_and_table('y', 'people', data)
Exemplo n.º 43
0
 def get_data():
     data = [{
         'id': 'one',
         'simple': ['x', 'y'],
         'complex': [{
             'val': 10
         }, {
             'val': 16
         }]
     }, {
         'id': 'two',
         'simple': ['x', 'z'],
         'complex': [{
             'val': 10
         }]
     }]
     return as_db_and_table('z', 't', data)
Exemplo n.º 44
0
 def get_data():
     data = [{
         'id': 'joe-id',
         'name': 'joe',
         'hobby': 'guitar'
     }, {
         'id': 'bob-id',
         'name': 'bob',
         'hobby': 'pseudointellectualism'
     }, {
         'id': 'bill-id',
         'name': 'bill'
     }, {
         'id': 'kimye-id',
         'name': 'kimye',
         'hobby': 'being kimye'
     }]
     return as_db_and_table('x', 'people', data)
Exemplo n.º 45
0
 def get_data():
     data = [
         {
             'id': 'one',
             'name': 'One',
             'pets': ['dog', 'cat', 'bird']
         },
         {
             'id': 'two',
             'name': 'Two',
             'pets': ['fish', 'another fish']
         },
         {
             'id': 'three',
             'name': 'Three',
             'pets': ['toad', 'rabbit']
         }
     ]
     return as_db_and_table('generic', 'table', data)
Exemplo n.º 46
0
 def get_data():
     data = [
         {
             'id': 'joe',
             'attributes': {
                 'face': 'bad',
                 'toes': 'fugly'
             },
             'joe-attr': True
         },
         {
             'id': 'sam',
             'attributes': {
                 'face': 'eh',
                 'blog': 'dry'
             },
             'sam-attr': True
         }
     ]
     return as_db_and_table('y', 'people', data)
Exemplo n.º 47
0
 def get_data():
     data = [
         {
             'id': 'id-1',
             'x': {
                 'x-val': 'x-val-1'
             },
             'y': {
                 'y-val': 'y-val-1'
             }
         },
         {
             'id': 'id-2',
             'x': {
                 'x-val': 'x-val-2'
             },
             'y': {
                 'y-val': 'y-val-2'
             }
         }
     ]
     return as_db_and_table('jezebel', 'things', data)
Exemplo n.º 48
0
 def get_data():
     data = [
         {
             'id': 'thing-1',
             'values': {
                 'a': 'a-1',
                 'b': 'b-1',
                 'c': 'c-1',
                 'd': 'd-1'
             }
         },
         {
             'id': 'thing-2',
             'values': {
                 'a': 'a-2',
                 'b': 'b-2',
                 'c': 'c-2',
                 'd': 'd-2'
             }
         },
     ]
     return as_db_and_table('some_db', 'things', data)
Exemplo n.º 49
0
 def get_data():
     data = [
         {'id': 'foo'}
     ]
     return as_db_and_table('db', 'fonz', data)
Exemplo n.º 50
0
 def get_data():
     data = [
         {'id': 'say_anything'},
     ]
     return as_db_and_table('unimportant', 'very', data)
Exemplo n.º 51
0
 def get_data():
     data = [
         {'id': 'joe', 'last_updated': rtime.make_time(2014, 6, 3, 12, 10, 32)},
         {'id': 'sam', 'last_updated': rtime.make_time(2014, 8, 25, 17, 3, 54)}
     ]
     return as_db_and_table('d', 'people', data)
Exemplo n.º 52
0
 def get_data():
     data = [
         {'id': 'joe', 'last_updated': r.time(2014, 6, 3, 'Z')},
         {'id': 'sam', 'last_updated': r.time(2014, 8, 25, 'Z')}
     ]
     return as_db_and_table('d', 'people', data)
Exemplo n.º 53
0
 def get_data():
     data = [
         {'id': 'joe', 'last_updated': datetime.datetime(2014, 6, 3, 0, 0, 1, tzinfo=r.make_timezone('00:00'))},
         {'id': 'sam', 'last_updated': datetime.datetime(2014, 8, 25, 0, 0, 0, tzinfo=r.make_timezone('00:00'))}
     ]
     return as_db_and_table('d', 'people', data)
Exemplo n.º 54
0
 def get_data():
     data = [
         {'id': 1, 'animals': ['frog', 'cow']},
         {'id': 2, 'animals': ['horse']}
     ]
     return as_db_and_table('x', 'farms', data)