def test_contains_extractor_with_list(): text = ["Simple", "is", "better", "than", "complex"] features = contains_extractor(text) assert_true(features['contains(Simple)']) assert_false(features.get("contains(simple)", False)) assert_true(features['contains(complex)']) assert_false(features.get("contains(derp)", False))
def test_contains_extractor_with_string(): text = "Simple is better than complex" features = contains_extractor(text) assert_true(features["contains(Simple)"]) assert_false(features.get('contains(simple)', False)) assert_true(features['contains(complex)']) assert_false(features.get("contains(derp)", False))