Example #1
0
def test_construct_same_selectors():
    int_selector_1 = Selector(fields={'an_int': Field(int)})
    int_selector_2 = Selector(fields={'an_int': Field(int)})

    # assert identical object
    assert int_selector_1 is int_selector_2
    # assert equivalent key
    assert int_selector_1.inst().key == int_selector_2.inst().key
Example #2
0
def test_construct_different_selectors():
    int_selector = Selector(fields={'an_int': Field(int)})
    string_selector = Selector(fields={'a_string': Field(str)})

    assert int_selector is not string_selector
    assert int_selector.inst().key != string_selector.inst().key