Exemplo n.º 1
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.º 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, 36],
         'nums2': [{
             'val': 26
         }, {
             'val': 78
         }, {
             'val': 19
         }, {
             'val': 110
         }, {
             'val': 82
         }]
     }]
     return as_db_and_table('x', 'people', data)
Exemplo n.º 3
0
 def get_data():
     data = [
         {
             'id': 'say_anything'
         },
     ]
     return as_db_and_table('unimportant', 'very', data)
Exemplo n.º 4
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.º 5
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.º 6
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.º 7
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)
Exemplo n.º 8
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'},
            {'id': 'zuul', 'first_name': 'Adam', 'last_name': 'Zuul'}

        ]
        return as_db_and_table('s', 'people', data)
Exemplo n.º 9
0
 def get_data():
     data = [{
         'id': 1,
         'animals': ['frog', 'cow']
     }, {
         'id': 2,
         'animals': ['horse']
     }]
     return as_db_and_table('x', 'farms', data)
Exemplo n.º 10
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.º 11
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.º 12
0
 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.º 13
0
 def get_data():
     data = [{
         'id': 'one',
         'data': list(range(10, 20))
     }, {
         'id': 'two',
         'data': list(range(20, 30))
     }, {
         'id': 'three',
         'data': list(range(30, 40))
     }]
     return as_db_and_table('db', 'things', data)
Exemplo n.º 14
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.º 15
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.º 16
0
 def get_data():
     data = [{
         'id': 'joe',
         'last_updated': rtime.make_time(2019, 6, 2)
     }, {
         'id': 'sam',
         'last_updated': rtime.make_time(2020, 6, 3)
     }, {
         'id': 'mia',
         'last_updated': rtime.make_time(2030, 6, 3)
     }]
     return as_db_and_table('d', 'people', data)
Exemplo n.º 17
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.º 18
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.º 19
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.º 20
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.º 21
0
 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.º 22
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.º 23
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.º 24
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.º 25
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.º 26
0
 def get_data():
     data = [
         {
             'id': 'present',
             'last_updated': rtime.now()
         },  # Present
         {
             'id': 'past',
             'last_updated': rtime.make_time(2020, 6, 3)
         },  # Past
         {
             'id': 'future',
             'last_updated': rtime.make_time(2030, 6, 3)
         }  # Future
     ]
     return as_db_and_table('d', 'people', data)
Exemplo n.º 27
0
 def get_data():
     data = [{
         'id': 'joe',
         'age': 43,
         'hobbies': ['sand', 'water', 'cats']
     }, {
         'id': 'bill',
         'age': 48,
         'hobbies': ['watermelon']
     }, {
         'id': 'todd',
         'age': 29,
         'hobbies': ['citrus'],
         'nums': [40, 67, 40, 800, 900]
     }]
     return as_db_and_table('x', 'people', data)
Exemplo n.º 28
0
def conn_sess(request):
    cfg = request.config
    conn_type = cfg.getvalue("conn_type")
    if conn_type == "rethink":
        try:
            server = _rethink_server(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 == "rethinkdb_mock":
        conn = MockThink(as_db_and_table('nothing', 'nothing', [])).get_conn()
    else:
        pytest.exit(
            f"Unknown rethinkdb_mock test connection type: {conn_type}")
    return conn
Exemplo n.º 29
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.º 30
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)