Пример #1
0
def test_get_user_pbis(mock_api):
    result = list(mock_api.get_user_pbis("*****@*****.**"))
    expected = list([
        create_work_item_container(generate_work_item(number))
        for number in range(100000, 100005)
    ])
    assert len(result) == len(expected)
    for i in range(0, len(result)):
        assert result[i] == expected[i]
Пример #2
0
def test_get_unassigned_work_item(mock_api, monkeypatch):
    # patch the client to return an unassigned work item
    def get_unassigned_work_item(*args, **kwargs):
        return generate_work_item(100000, assigned=False)

    monkeypatch.setattr(mock_api.work_item_client, "get_work_item",
                        get_unassigned_work_item)

    result = mock_api.get_work_item(100000)
    expected = create_work_item_container(
        generate_work_item(100000, assigned=False))
    assert result == expected
Пример #3
0
 def get_bad_type_work_items(*args, **kwargs):
     return [generate_work_item(100000, work_item_type="Task")]
Пример #4
0
 def get_unassigned_work_item(*args, **kwargs):
     return generate_work_item(100000, assigned=False)
Пример #5
0
def test_get_work_item(mock_api):
    result = mock_api.get_work_item(100000)
    expected = create_work_item_container(generate_work_item(100000))
    assert result == expected
Пример #6
0
def test_assign_work_item(mock_api):
    result = mock_api.assign_work_item(100000, "*****@*****.**")
    expected = generate_work_item(100000, assigned_to="*****@*****.**")
    assert result.work_item == expected
Пример #7
0
def test_move_work_item(mock_api):
    result = mock_api.move_work_item(100000, "In Dev")
    expected = generate_work_item(100000, kanban_column="In Dev")
    assert result.work_item == expected