示例#1
0
 def _filter_table():
     table = Table(
         Pod,
         {
             "kind": "Table",
             "columnDefinitions": [{"name": "A"}, {"name": "C"}, {"name": "E"}],
             "rows": [{"cells": ["a", "c", "e"]}] * 100,
             "clusters": ["c1"],
         },
     )
     filter_table(table, "c")
示例#2
0
def test_filter_table_text_match_case_insensitive2(single_pod_table):
    table = single_pod_table
    filter_table(table, "backoff")
    assert len(table.rows) == 1
示例#3
0
def test_filter_table_text_match(single_pod_table):
    table = single_pod_table
    filter_table(table, "myname")
    assert len(table.rows) == 1
示例#4
0
def test_filter_table_whitespace_ignore(single_pod_table):
    table = single_pod_table
    filter_table(table, " Name = myname ")
    assert len(table.rows) == 1
示例#5
0
def test_filter_table_column_match(single_pod_table):
    table = single_pod_table
    filter_table(table, "Name=myname")
    assert len(table.rows) == 1
示例#6
0
def test_filter_table_no_match(single_pod_table):
    table = single_pod_table
    filter_table(table, "Name=b")
    assert len(table.rows) == 0
示例#7
0
def test_filter_table_wrong_column_name(single_pod_table):
    table = single_pod_table
    filter_table(table, "a=b")
    assert len(table.rows) == 0
示例#8
0
def test_filter_table_not_equal(two_pod_table):
    table = two_pod_table
    filter_table(table, "Name!=pod-a")
    assert len(table.rows) == 1
    assert table.rows[0]["cells"][0] == "pod-b"
示例#9
0
def test_filter_table_not_equal_and(two_pod_table):
    table = two_pod_table
    filter_table(table, "Status!=Running,Status!=Completed")
    assert len(table.rows) == 0
示例#10
0
def test_filter_table_text_no_match_multi(single_pod_table):
    table = single_pod_table
    # "my" matches first column, but "xxx" does not match
    filter_table(table, "my, xxx")
    assert len(table.rows) == 0
示例#11
0
def test_filter_table_text_match_multi(single_pod_table):
    table = single_pod_table
    # letters "m" and "a" are in both cells
    filter_table(table, "m, a")
    assert len(table.rows) == 1
示例#12
0
def test_filter_table_text_match_label2(single_pod_table_with_labels):
    table = single_pod_table_with_labels
    filter_table(table, "labelval1", match_labels=True)
    assert len(table.rows) == 1
示例#13
0
def test_filter_table_empty(single_pod_table):
    table = single_pod_table
    filter_table(table, "")
    assert len(table.rows) == 1