コード例 #1
0
def test_run5():
    raw_lookml = """
      view: aview {
        dimension: memberID {
          type: string
        }
      }
    """
    dj = get_1st_dimension(raw_lookml)
    relevant, passed = DrillDownRule().run(dj)
    assert not relevant
    assert not passed
コード例 #2
0
def test_run2():
    raw_lookml = """
      view: aview {
        measure: count {
          type: count
        }
      }
    """
    mj = get_1st_measure(raw_lookml)
    relevant, passed = DrillDownRule().run(mj)
    assert relevant
    assert not passed
コード例 #3
0
def test_run3():
    raw_lookml = """
      view: aview {
        measure: count {
          type: count
          drill_fields: ["year_name",
            "quarter_name",
            "day_name",
            "month_name"]
        }
      }
    """
    mj = get_1st_measure(raw_lookml)
    relevant, passed = DrillDownRule().run(mj)
    assert relevant
    assert passed
コード例 #4
0
def test_run4():
    #this has a hanging comma in list which lkml parser should handle
    raw_lookml = """
      view: aview {
        measure: count {
          type: count
          drill_fields: ["year_name",
            "quarter_name",
            "day_name",
            "month_name",
            ]
        }
      }
    """
    mj = get_1st_measure(raw_lookml)
    relevant, passed = DrillDownRule().run(mj)
    assert relevant
    assert passed