Пример #1
0
def test_cross_join():
    dataset = DataSet()
    dataset.add_adapter(EmployeeAdapter())

    q = Query(dataset, JoinOp(LoadOp('employees'), LoadOp('employees')))
    evaluate = compile(q)
    eq_(len(list(evaluate(dict(dataset=dataset)))), 9)
Пример #2
0
def test_selection():
    dataset = DataSet()
    dataset.add_adapter(EmployeeAdapter())

    q = Query(
        dataset,
        SelectionOp(LoadOp('employees'), EqOp(Var('manager_id'), NullConst())))

    evaluate = compile(q)

    assert_sequence_equal(list(evaluate(dict(dataset=dataset))), [
        (1234, 'Tom Tompson', date(2009, 1, 17), None, ()),
    ])

    q = Query(
        dataset,
        SelectionOp(LoadOp('employees'),
                    NotOp(EqOp(Var('manager_id'), NullConst()))))

    evaluate = compile(q)

    assert_sequence_equal(list(evaluate(dict(dataset=dataset))),
                          [(4567, 'Sally Sanders', date(2010, 2, 24), 1234,
                            ()),
                           (8901, 'Mark Markty', date(2010, 3, 1), 1234,
                            ('sales', 'marketing'))])
Пример #3
0
def test_decorator_function_calls():
  dataset = DataSet()
  dataset.add_adapter(EmployeeAdapter())

  @dataset.function(returns=dict(name="initials", type="STRING"))
  def initials(name):
    if name:
      return ''.join([p[0] for p in name.split()])
    else:
      return None

 

  q = Query(
    dataset,  
    ProjectionOp(LoadOp('employees'), Function('initials', Var('full_name')))
  )
  evaluate = compile(q)

  assert_sequence_equal(
    list(evaluate(dict(dataset=dataset))),
    [
      ('TT',),
      ('SS',),
      ('MM',),
    ]
  )
Пример #4
0
def test_function_in_from():
    dataset = DataSet()
    dataset.add_adapter(EmployeeAdapter())

    q = Query(
        dataset,
        ProjectionOp(
            Function('flatten', LoadOp('employees'), StringConst('roles')),
            Var('manager_id'), Var('roles')))

    evaluate = compile(q)

    assert_sequence_equal(list(evaluate(dict(dataset=dataset))),
                          [(1234, 'sales'), (1234, 'marketing')])

    q = Query(dataset,
              Function('flatten', LoadOp('employees'), StringConst('roles')))

    evaluate = compile(q)

    assert_sequence_equal(
        list(evaluate(dict(dataset=dataset))),
        [[8901, 'Mark Markty',
          date(2010, 3, 1), 1234, 'sales'],
         [8901, 'Mark Markty',
          date(2010, 3, 1), 1234, 'marketing']])
Пример #5
0
def test_relpace_views():
  dataset = DataSet()
  dataset.add_adapter(EmployeeAdapter())

  no_managers = SelectionOp(
    LoadOp('employees'),
    IsOp(Var('manager_id'), NullConst())
  )

  dataset.create_view(
    'no_managers',
    no_managers
  )

  eq_(
    replace_views(LoadOp('no_managers'), dataset),
    no_managers
  )

  eq_(
    replace_views(
      JoinOp(
        LoadOp('no_managers'),
        LoadOp('no_managers')
      ),
      dataset
    ),

    JoinOp(
      no_managers,
      no_managers
    )

  )
Пример #6
0
def test_self_join_with_projection():
  dataset = DataSet()
  dataset.add_adapter(EmployeeAdapter())

  q = Query(
    dataset,  
    ProjectionOp(
      JoinOp(
        AliasOp('manager', LoadOp('employees')),
        AliasOp('employee', LoadOp('employees')),
        EqOp(Var('manager.employee_id'), Var('employee.manager_id'))
      ),
      SelectAllExpr('employee'),
      RenameOp('manager', Var('manager.full_name'))
    )
  )

  evaluate = compile(q)



  assert_sequence_equal(
    list(evaluate(dict(dataset=dataset))),
    [
      (4567, 'Sally Sanders', date(2010, 2, 24), 1234, (), 'Tom Tompson'),
      (8901, 'Mark Markty', date(2010, 3, 1), 1234,  ('sales', 'marketing'), 'Tom Tompson')
    ]
  )
Пример #7
0
def test_query_builder():
    dataset = DataSet()
    adapter = MockAdapter()
    dataset.add_adapter(adapter)
    query = dataset.select('x')

    eq_(isinstance(query, QueryBuilder), True)
    eq_(query.dataset, dataset)
    eq_(query.column_exps, 'x')
Пример #8
0
def test_query_builder():
  dataset = DataSet()
  adapter = MockAdapter()
  dataset.add_adapter(adapter)
  query = dataset.select('x')

  eq_(isinstance(query, QueryBuilder), True)
  eq_(query.dataset, dataset)
  eq_(query.column_exps, 'x')
Пример #9
0
def test_aggregation_whole_table():
    dataset = DataSet()
    dataset.add_adapter(EmployeeAdapter())

    q = Query(dataset, ProjectionOp(LoadOp('employees'), Function('count')))
    evaluate = compile(q)

    assert_sequence_equal(list(evaluate(dict(dataset=dataset))), [
        (3, ),
    ])
Пример #10
0
def test_paramgetter():
    dataset = DataSet()
    dataset.add_adapter(EmployeeAdapter())

    q = Query(dataset, ProjectionOp(LoadOp(''), ParamGetterOp(0)))

    evaluate = compile(q)

    assert_sequence_equal(
        list(evaluate(dict(dataset=dataset, params=('foo', )))), [('foo', )])
Пример #11
0
def test_limit():
    dataset = DataSet()
    dataset.add_adapter(EmployeeAdapter())

    q = Query(dataset, SliceOp(LoadOp('employees'), 1))
    evaluate = compile(q)

    assert_sequence_equal(list(evaluate(dict(dataset=dataset))), [
        (1234, 'Tom Tompson', date(2009, 1, 17), None, ()),
    ])
Пример #12
0
def test_offset_and_limit():
    dataset = DataSet()
    dataset.add_adapter(EmployeeAdapter())

    q = Query(dataset, SliceOp(LoadOp('employees'), 1, 2))
    evaluate = compile(q)

    assert_sequence_equal(list(evaluate(dict(dataset=dataset))), [
        (4567, 'Sally Sanders', date(2010, 2, 24), 1234, ()),
    ])
Пример #13
0
def test_projection():
    dataset = DataSet()
    dataset.add_adapter(EmployeeAdapter())

    q = Query(dataset, ProjectionOp(LoadOp('employees'), Var('full_name')))

    evaluate = compile(q)

    assert_sequence_equal(list(evaluate(dict(dataset=dataset))),
                          [('Tom Tompson', ), ('Sally Sanders', ),
                           ('Mark Markty', )])
Пример #14
0
def test_offset():
    dataset = DataSet()
    dataset.add_adapter(EmployeeAdapter())

    q = Query(dataset, SliceOp(LoadOp('employees'), 1, None))
    evaluate = compile(q)

    assert_sequence_equal(list(evaluate(dict(dataset=dataset))), [
        (4567, 'Sally Sanders', date(2010, 2, 24), 1234, ()),
        (8901, 'Mark Markty', date(2010, 3, 1), 1234, ('sales', 'marketing')),
    ])
Пример #15
0
def test_order_by_asc():
    dataset = DataSet()
    dataset.add_adapter(EmployeeAdapter())

    q = Query(dataset, OrderByOp(LoadOp('employees'), Asc(Var('employee_id'))))
    evaluate = compile(q)

    assert_sequence_equal(list(evaluate(dict(dataset=dataset))), [
        (1234, 'Tom Tompson', date(2009, 1, 17), None, ()),
        (4567, 'Sally Sanders', date(2010, 2, 24), 1234, ()),
        (8901, 'Mark Markty', date(2010, 3, 1), 1234, ('sales', 'marketing')),
    ])
Пример #16
0
def test_get_relation():
    dataset = DataSet()

    adapter = MockAdapter()
    dataset.add_adapter(adapter)

    s_table = adapter.get_relation('bogus')

    table = dataset.get_relation('bogus')
    eq_(table, s_table)

    assert_sequence_equal(dataset.relations, [('bogus', s_table)])
Пример #17
0
def test_addition():
    dataset = DataSet()
    dataset.add_adapter(EmployeeAdapter())

    q = Query(
        dataset,
        ProjectionOp(LoadOp('employees'),
                     AddOp(Var('employee_id'), NumberConst(1))))
    evaluate = compile(q)

    assert_sequence_equal(list(evaluate(dict(dataset=dataset))), [(1235, ),
                                                                  (4568, ),
                                                                  (8902, )])
Пример #18
0
def test_aggregation_on_column():
    dataset = DataSet()
    dataset.add_adapter(EmployeeAdapter())

    q = Query(
        dataset,
        GroupByOp(
            ProjectionOp(LoadOp('employees'), Var('manager_id'),
                         Function('count')), Var('manager_id')))
    evaluate = compile(q)

    assert_sequence_equal(list(evaluate(dict(dataset=dataset))), [(None, 1),
                                                                  (1234, 2)])
Пример #19
0
def test_cross_join():
  dataset = DataSet()
  dataset.add_adapter(EmployeeAdapter())

  q = Query(
    dataset, 
    JoinOp(LoadOp('employees'), LoadOp('employees'))
  )
  evaluate = compile(q)
  eq_(
    len(list(evaluate(dict(dataset=dataset)))),
    9
  )
Пример #20
0
def test_projection():
  dataset = DataSet()
  dataset.add_adapter(EmployeeAdapter())

  q = Query(
    dataset,  
    ProjectionOp(LoadOp('employees'), Var('full_name'))
  )
  evaluate = compile(q)

  assert_sequence_equal(
    list(evaluate(dict(dataset=dataset))),
    [('Tom Tompson',), ('Sally Sanders',), ('Mark Markty',)]
  )
Пример #21
0
def test_get_relation():
  dataset = DataSet()

  adapter = MockAdapter()
  dataset.add_adapter(adapter)

  s_table = adapter.get_relation('bogus')

  table = dataset.get_relation('bogus')
  eq_(table, s_table)

  assert_sequence_equal(
    dataset.relations, 
    [('bogus', s_table)]
  )
Пример #22
0
def test_addition():
  dataset = DataSet()
  dataset.add_adapter(EmployeeAdapter())


  q = Query(
    dataset, 
    ProjectionOp(LoadOp('employees'), AddOp(Var('employee_id'), NumberConst(1)))
  )
  evaluate = compile(q)

  assert_sequence_equal(
    list(evaluate(dict(dataset=dataset))),
    [(1235,), (4568,), (8902,)]
  )
Пример #23
0
def test_views():
    dataset = DataSet()
    adapter = dataset.add_adapter(MockAdapter())

    # create a view off of an existing table
    dataset.select('x').frm('bogus').create_view('only_x')

    view = dataset.get_view('only_x')

    eq_(view, AliasOp('only_x', ProjectionOp(LoadOp('bogus'), Var('x'))))

    # create a view off of a view
    dataset.select('x').frm('only_x').create_view('only_x_from_x')

    view = dataset.get_view('only_x_from_x')

    compare(
        view,
        # Todo: Implement a query optimizer that eliminates
        # redunant projections ops like the one we see below
        AliasOp(
            'only_x_from_x',
            ProjectionOp(
                AliasOp('only_x', ProjectionOp(LoadOp('bogus'), Var('x'))),
                Var('x'))))
Пример #24
0
def test_views():
  dataset = DataSet()
  adapter = dataset.add_adapter(MockAdapter())
  
  # create a view off of an existing table
  dataset.select('x').frm('bogus').create_view('only_x')

  view = dataset.get_view('only_x')

  eq_(
    view,
    AliasOp('only_x', ProjectionOp(LoadOp('bogus'), Var('x')))
  )
 
  # create a view off of a view
  dataset.select('x').frm('only_x').create_view('only_x_from_x')

  view = dataset.get_view('only_x_from_x')

  compare(
    view,
    # Todo: Implement a query optimizer that eliminates
    # redunant projections ops like the one we see below
    AliasOp('only_x_from_x', ProjectionOp(
      AliasOp('only_x',ProjectionOp(LoadOp('bogus'), Var('x'))),
      Var('x')
    )
  ))
Пример #25
0
def test_replace_view_within_a_view():
  dataset = DataSet()
  adapter = dataset.add_adapter(MockAdapter())
 
  dataset.create_view(
    'view1',
    LoadOp('bogus')
  )

  dataset.create_view(
    'view2',
    LoadOp('view1')
  )

  dataset.create_view(
    'view3',
    SelectionOp(LoadOp('view2'), IsOp(Var('x'), NullConst()))
  )

  v1 = replace_views(
    LoadOp('view3'), 
    dataset
  )

  compare(
    v1,
    AliasOp('view3',
      SelectionOp(
        AliasOp('view2', AliasOp('view1',LoadOp('bogus'))),
        IsOp(Var('x'), NullConst())
      )
    )
  )
Пример #26
0
def test_replace_views():
  dataset = DataSet()
  adapter = dataset.add_adapter(MockAdapter())

  no_managers = SelectionOp(
    LoadOp('bogus'),
    IsOp(Var('manager_id'), NullConst())
  )

  dataset.create_view(
    'no_managers',
    no_managers
  )

  view = AliasOp('no_managers', no_managers)
  compare(
    replace_views(LoadOp('no_managers'), dataset),
    view
  )

  compare(
    replace_views(
      JoinOp(
        LoadOp('no_managers'),
        LoadOp('no_managers')
      ),
      dataset
    ),

    JoinOp(
      view,
      view
    )

  )
Пример #27
0
def test_offset_and_limit():
  dataset = DataSet()
  dataset.add_adapter(EmployeeAdapter())

  q = Query(
    dataset, 
    SliceOp(LoadOp('employees'), 1,2)
  )
  evaluate = compile(q)

  assert_sequence_equal(
    list(evaluate(dict(dataset=dataset))),
    [
      (4567, 'Sally Sanders', date(2010, 2, 24), 1234, ()),
    ]
  )
Пример #28
0
def test_complier():
    adapter = MockAdapter()

    def compile(query):
        return lambda ctx, *params: Table(
            adapter,
            'results!',
            schema=dict(fields=[dict(name="?column?", type="INTEGER")]))

    dataset = DataSet()
    dataset.add_adapter(adapter)
    dataset.set_compiler(compile)

    query = dataset.frm('bogus').query

    table = dataset.execute(query)
Пример #29
0
def test_limit():
  dataset = DataSet()
  dataset.add_adapter(EmployeeAdapter())

  q = Query(
    dataset, 
    SliceOp(LoadOp('employees'), 1)
  )
  evaluate = compile(q)

  assert_sequence_equal(
    list(evaluate(dict(dataset=dataset))),
    [
      (1234, 'Tom Tompson', date(2009, 1, 17), None, ()),
    ]
  )
Пример #30
0
def test_aggregation_whole_table():
  dataset = DataSet()
  dataset.add_adapter(EmployeeAdapter())

  q = Query(
    dataset,  
    ProjectionOp(LoadOp('employees'), Function('count'))
  )
  evaluate = compile(q)

  assert_sequence_equal(
    list(evaluate(dict(dataset=dataset))),
    [
      (3,),
    ]
  )
Пример #31
0
def test_paramgetter():
  dataset = DataSet()
  dataset.add_adapter(EmployeeAdapter())

  q = Query(
    dataset,  
    ProjectionOp(LoadOp(''), ParamGetterOp(0))
  )

  evaluate = compile(q)

  assert_sequence_equal(
    list(evaluate(dict(dataset=dataset, params=('foo',)))),
    [
      ('foo',)
    ]
  )
Пример #32
0
def test_offset():
  dataset = DataSet()
  dataset.add_adapter(EmployeeAdapter())

  q = Query(
    dataset, 
    SliceOp(LoadOp('employees'), 1,None)
  )
  evaluate = compile(q)

  assert_sequence_equal(
    list(evaluate(dict(dataset=dataset))),
    [
      (4567, 'Sally Sanders', date(2010, 2, 24), 1234, ()),
      (8901, 'Mark Markty', date(2010, 3, 1), 1234, ('sales', 'marketing')),
 
    ]
  )
Пример #33
0
def test_self_join():
    dataset = DataSet()
    dataset.add_adapter(EmployeeAdapter())

    q = Query(
        dataset,
        JoinOp(AliasOp('employee', LoadOp('employees')),
               AliasOp('manager', LoadOp('employees')),
               EqOp(Var('manager.employee_id'), Var('employee.manager_id'))))
    evaluate = compile(q)

    assert_sequence_equal(
        list(evaluate(dict(dataset=dataset))),
        [(4567, 'Sally Sanders', date(2010, 2, 24), 1234,
          (), 1234, 'Tom Tompson', date(2009, 1, 17), None, ()),
         (8901, 'Mark Markty', date(2010, 3, 1), 1234,
          ('sales', 'marketing'), 1234, 'Tom Tompson', date(2009, 1, 17), None,
          ())])
Пример #34
0
def test_order_by_asc():
  dataset = DataSet()
  dataset.add_adapter(EmployeeAdapter())


  q = Query(
    dataset, 
    OrderByOp(LoadOp('employees'), Asc(Var('employee_id')))
  )
  evaluate = compile(q)

  assert_sequence_equal(list(evaluate(dict(dataset=dataset)))
    ,
    [
      (1234, 'Tom Tompson', date(2009, 1, 17), None, ()),
      (4567, 'Sally Sanders', date(2010, 2, 24), 1234, ()),
      (8901, 'Mark Markty', date(2010, 3, 1), 1234, ('sales', 'marketing')),
    ]
  )
Пример #35
0
def test_function_calls():
    dataset = DataSet()
    dataset.add_adapter(EmployeeAdapter())

    dataset.add_function(
        name='initials',
        function=lambda name: ''.join([p[0] for p in name.split()])
        if name else None,
        returns=dict(name="initials", type="STRING"))

    q = Query(
        dataset,
        ProjectionOp(LoadOp('employees'), Function('initials',
                                                   Var('full_name'))))
    evaluate = compile(q)

    assert_sequence_equal(list(evaluate(dict(dataset=dataset))), [
        ('TT', ),
        ('SS', ),
        ('MM', ),
    ])
Пример #36
0
def test_self_join_with_projection():
    dataset = DataSet()
    dataset.add_adapter(EmployeeAdapter())

    q = Query(
        dataset,
        ProjectionOp(
            JoinOp(
                AliasOp('manager', LoadOp('employees')),
                AliasOp('employee', LoadOp('employees')),
                EqOp(Var('manager.employee_id'), Var('employee.manager_id'))),
            SelectAllExpr('employee'),
            RenameOp('manager', Var('manager.full_name'))))

    evaluate = compile(q)

    assert_sequence_equal(list(evaluate(dict(dataset=dataset))),
                          [(4567, 'Sally Sanders', date(2010, 2, 24), 1234,
                            (), 'Tom Tompson'),
                           (8901, 'Mark Markty', date(2010, 3, 1), 1234,
                            ('sales', 'marketing'), 'Tom Tompson')])
Пример #37
0
def test_aggregation_on_column():
  dataset = DataSet()
  dataset.add_adapter(EmployeeAdapter())

  q = Query(
    dataset, 
    GroupByOp(

      ProjectionOp(LoadOp('employees'), Var('manager_id'), Function('count')), 
      Var('manager_id')
    )
  )
  evaluate = compile(q)

  assert_sequence_equal(
    list(evaluate(dict(dataset=dataset))),
    [
      (None,1),
      (1234,2)
    ]
  )
Пример #38
0
def test_get_schema():
    class Adapter(object):
        def has(self, name):
            return name == 'computed'

        def evaluate(self, loc):
            return loc.replace(Function('myschema'))

    dataset = DataSet()
    dataset.add_adapter(Adapter())

    # Todo: figure out why I have to invoke this decorator here

    @dataset.function(
        returns=lambda: Schema([dict(name='field', type='string')]))
    def myschema(ctx):
        pass

    schema = dataset.get_schema('computed')

    eq_(schema, Schema([dict(name='field', type='string')]))
Пример #39
0
def test_selection():
  dataset = DataSet()
  dataset.add_adapter(EmployeeAdapter())

  q = Query(
    dataset,
    SelectionOp(
      LoadOp('employees'), 
      EqOp(Var('manager_id'), NullConst())
    )
  )
  
  evaluate = compile(q)

  assert_sequence_equal(
    list(evaluate(dict(dataset=dataset))),
    [
      (1234, 'Tom Tompson', date(2009, 1, 17), None, ()),
    ]
  )


  q = Query(
    dataset, 
    SelectionOp(
      LoadOp('employees'),
      NotOp(EqOp(Var('manager_id'), NullConst()))
    )
  )
  
  evaluate = compile(q)

  assert_sequence_equal(
    list(evaluate(dict(dataset=dataset))),
    [
      (4567, 'Sally Sanders', date(2010, 2, 24), 1234, ()),
      (8901, 'Mark Markty', date(2010, 3, 1), 1234, ('sales', 'marketing'))
    ]
  )
Пример #40
0
def test_get_schema():
  class Adapter(object):
    def has(self, name): return name == 'computed'

    def evaluate(self, loc):
      return loc.replace(Function('myschema'))

  dataset = DataSet()
  dataset.add_adapter(Adapter())

  # Todo: figure out why I have to invoke this decorator here

  @dataset.function(returns = lambda:Schema([dict(name='field', type='string')]))
  def myschema(ctx):
    pass

  schema = dataset.get_schema('computed')

  eq_(
    schema,
    Schema([dict(name='field', type='string')])
  )
Пример #41
0
def test_complier():
  adapter = MockAdapter()

  def compile(query):
    return lambda ctx, *params: Table(
      adapter,
      'results!', 
      schema = dict(
        fields = [
          dict(name="?column?", type="INTEGER")
        ]
      )
    )


  dataset = DataSet()
  dataset.add_adapter(adapter)
  dataset.set_compiler(compile)

  query = dataset.frm('bogus').query

  table = dataset.execute(query)
Пример #42
0
def test_function_in_from():
  dataset = DataSet()
  dataset.add_adapter(EmployeeAdapter())

  q = Query(
    dataset,  
    ProjectionOp(
      Function('flatten', LoadOp('employees'), StringConst('roles')),
      Var('manager_id'),
      Var('roles')
    )
  )

  evaluate = compile(q)

  assert_sequence_equal(
    list(evaluate(dict(dataset=dataset))),
    [
      (1234, 'sales'),
      (1234, 'marketing')
    ]
  )

  q = Query(
    dataset, 
    Function('flatten', LoadOp('employees'), StringConst('roles'))
  )

  evaluate = compile(q)

  assert_sequence_equal(
    list(evaluate(dict(dataset=dataset))),
    [
      [8901, 'Mark Markty', date(2010, 3, 1), 1234, 'sales'],
      [8901, 'Mark Markty', date(2010, 3, 1), 1234, 'marketing']
    ]
  )
Пример #43
0
def test_self_join():
  dataset = DataSet()
  dataset.add_adapter(EmployeeAdapter())


  q = Query(
    dataset,  
    JoinOp(
      AliasOp('employee', LoadOp('employees')),
      AliasOp('manager', LoadOp('employees')),
      EqOp(Var('manager.employee_id'), Var('employee.manager_id'))
    )
  )
  evaluate = compile(q)



  assert_sequence_equal(
    list(evaluate(dict(dataset=dataset))),
    [
      (4567, 'Sally Sanders', date(2010, 2, 24), 1234, (), 1234, 'Tom Tompson', date(2009, 1, 17), None, ()),
      (8901, 'Mark Markty', date(2010, 3, 1), 1234, ('sales', 'marketing'), 1234, 'Tom Tompson', date(2009, 1, 17), None, ())
    ]
  )
Пример #44
0
def test_replace_views():
    dataset = DataSet()
    adapter = dataset.add_adapter(MockAdapter())

    no_managers = SelectionOp(LoadOp('bogus'),
                              IsOp(Var('manager_id'), NullConst()))

    dataset.create_view('no_managers', no_managers)

    view = AliasOp('no_managers', no_managers)
    compare(replace_views(LoadOp('no_managers'), dataset), view)

    compare(
        replace_views(JoinOp(LoadOp('no_managers'), LoadOp('no_managers')),
                      dataset), JoinOp(view, view))
Пример #45
0
def test_replace_view_within_a_view():
    dataset = DataSet()
    adapter = dataset.add_adapter(MockAdapter())

    dataset.create_view('view1', LoadOp('bogus'))

    dataset.create_view('view2', LoadOp('view1'))

    dataset.create_view(
        'view3', SelectionOp(LoadOp('view2'), IsOp(Var('x'), NullConst())))

    v1 = replace_views(LoadOp('view3'), dataset)

    compare(
        v1,
        AliasOp(
            'view3',
            SelectionOp(AliasOp('view2', AliasOp('view1', LoadOp('bogus'))),
                        IsOp(Var('x'), NullConst()))))
Пример #46
0
def mock_data_set():
    dataset = DataSet()
    dataset.add_adapter(MockAdapter())
    dataset.add_adapter(EmployeeAdapter())
    return dataset
Пример #47
0
def mock_data_set():
  dataset = DataSet()
  dataset.add_adapter(MockAdapter())
  dataset.add_adapter(EmployeeAdapter())
  return dataset