示例#1
0
def test_bug_command_setter_append(bug_fixture_prefetch):
    """Test appending commands to whiteboard"""
    bug = EnhancedBug(bugsy=None, **bug_fixture_prefetch)
    commands = bug.commands
    commands["fake_command"] = None
    bug.commands = commands
    assert bug.whiteboard == "[bugmon:confirmed,verify,fake_command]"
示例#2
0
def test_bug_command_setter_remove_command(bug_fixture_prefetch):
    """Test removing command from whiteboard"""
    data = copy.deepcopy(bug_fixture_prefetch)
    data["whiteboard"] = "[something-else][bugmon:verify]"
    bug = EnhancedBug(bugsy=None, **data)
    bug.commands = {}

    assert bug.whiteboard == "[something-else]"
示例#3
0
def test_bug_command_setter_empty_whiteboard(bug_fixture_prefetch):
    """Test initialization of bugmon command on whiteboard"""
    data = copy.deepcopy(bug_fixture_prefetch)
    data["whiteboard"] = ""
    bug = EnhancedBug(bugsy=None, **data)
    bug.commands = {"fake_command": None}

    assert bug.whiteboard == "[bugmon:fake_command]"
示例#4
0
def test_bug_command_setter_empty_bugmon(bug_fixture_prefetch):
    """Test setting command where bugmon exists on whiteboard with no commands"""
    data = copy.deepcopy(bug_fixture_prefetch)
    data["whiteboard"] = "[bugmon:]"
    bug = EnhancedBug(bugsy=None, **data)
    bug.commands = {"fake_command": None}

    assert bug.whiteboard == "[bugmon:fake_command]"
示例#5
0
def test_bug_command_setter_replace(bug_fixture_prefetch):
    """Test replacing commands"""
    bug = EnhancedBug(bugsy=None, **bug_fixture_prefetch)
    bug.commands = {"fake_command": None}

    assert bug.whiteboard == "[bugmon:fake_command]"