def match_sequence(cls, expect): # dict 或 list 中能匹配到 expect[] 中的指定顺序的元素 # list('abcd') | should.match_sequence(['a', 'b']) # True # list('abcd') | should-match_sequence(['a', 'c', 'd']) # True # list('abbbacd') | should.match_sequence(['a', 'b']) # True # list('abbbacd') | should.match_sequence(['b', 'a', 'd']) # True # list('abcd') | should-match_sequence(['e', 'f', 'g']) # False # list('abcd') | should-match_sequence(['c', 'a']) # False # [] | should.match_sequence(['a', 'b']) # False return should(expect, 'match_sequence')
def be_list_of_zeroes(cls, expect=None): return should(expect, 'be_list_of_zeroes')
def contains(cls, expect): return should(expect, 'contains')
def sum_to(cls, expect): return should(expect, 'sum_to')
def starts_with(cls, expect): return should(expect, 'starts_with')
def like(cls, expect): return should(expect, 'like')
def equal(cls, expect): return should(expect, 'equal')