def test_mops_instantiation(): mops_set = Mops(create_argv(test_command_9)) assert len(mops_set) == 4 assert ("m" in mops_set) == True assert ("o" in mops_set) == True assert ("p" in mops_set) == True assert ("s" in mops_set) == True assert ("z" in mops_set) == False
def test_mops_contains(): mops_set = Mops(create_argv(test_command_9)) assert len(mops_set) == 4 assert mops_set.contains(("m")) == True assert mops_set.contains(("m", "o")) == True assert mops_set.contains(("m", "o", "p")) == True assert mops_set.contains(("m", "o", "p", "s")) == True assert mops_set.contains(("b")) == False # switch character that is not present should yield False assert mops_set.contains(("m", "b")) == False # single missing switch character should yield False
def test_mops_contains(): mops_set = Mops(create_argv(test_command_9)) assert len(mops_set) == 4 assert mops_set.contains(("m")) == True assert mops_set.contains(("m", "o")) == True assert mops_set.contains(("m", "o", "p")) == True assert mops_set.contains(("m", "o", "p", "s")) == True assert mops_set.contains( ("b" )) == False # switch character that is not present should yield False assert mops_set.contains( ("m", "b")) == False # single missing switch character should yield False
def test_mops_instantiation_multiple_mops_in_command(): mops_set = Mops(create_argv(test_command_11)) assert len( mops_set ) == 6 # set data type should eliminate multiple requested switches that are the same assert ("m" in mops_set) == True assert ("o" in mops_set) == True assert ("p" in mops_set) == True assert ("s" in mops_set) == True assert ("t" in mops_set) == True assert ("e" in mops_set) == True assert ("z" in mops_set) == False
def test_mops_str_method_empty(): mops_set = Mops(create_argv(test_command_2)) assert len(mops_set) == 0 assert mops_set.__str__() == """{}""" or mops_set.__repr__() == """{}"""
def test_mops_str_method(): mops_set = Mops(create_argv(test_command_12)) assert len(mops_set) == 2 assert mops_set.__str__() == """{'m', 'o'}""" or mops_set.__repr__( ) == """{'o', 'm'}"""
def test_mops_str_method(): mops_set = Mops(create_argv(test_command_12)) assert len(mops_set) == 2 assert mops_set.__str__() == """{'m', 'o'}""" or mops_set.__repr__() == """{'o', 'm'}"""