lint test utils (#395)

This commit is contained in:
bmc-msft
2021-01-05 08:50:52 -05:00
committed by GitHub
parent 014cb5bcfd
commit 75d2ffd7f4
3 changed files with 15 additions and 12 deletions

View File

@ -25,15 +25,14 @@ from enum import Enum
from typing import Dict, List, Optional, Set, Tuple
from uuid import UUID, uuid4
from onefuzz.api import Command, Onefuzz
from onefuzz.backend import ContainerWrapper, wait
from onefuzz.cli import execute_api
from onefuzztypes.enums import OS, ContainerType, TaskState, VmState
from onefuzztypes.models import Job, Pool, Repro, Scaleset
from onefuzztypes.primitives import Directory, File
from pydantic import BaseModel, Field
from onefuzz.api import Command, Onefuzz
from onefuzz.backend import ContainerWrapper, wait
from onefuzz.cli import execute_api
LINUX_POOL = "linux-test"
WINDOWS_POOL = "linux-test"
BUILD = "0"

View File

@ -7,8 +7,9 @@ import argparse
import os
import sys
import time
from azure.devops.connection import Connection
from azure.devops.credentials import BasicTokenAuthentication, BasicAuthentication
from azure.devops.credentials import BasicAuthentication, BasicTokenAuthentication
from azure.devops.v6_0.work_item_tracking.models import Wiql
@ -17,11 +18,11 @@ def main() -> None:
formatter_class=argparse.ArgumentDefaultsHelpFormatter
)
parser.add_argument(
"--url", default="https://dev.azure.com/your-instance-name", help="ADO Instance URL"
)
parser.add_argument(
"--areapath", default="OneFuzz-Test-Project", help="areapath"
"--url",
default="https://dev.azure.com/your-instance-name",
help="ADO Instance URL",
)
parser.add_argument("--areapath", default="OneFuzz-Test-Project", help="areapath")
parser.add_argument("--title", help="work item title")
parser.add_argument(
"--expected", type=int, help="expected number of work items", default=1
@ -65,9 +66,11 @@ def main() -> None:
time.sleep(2)
print("trying again", flush=True)
assert len(work_items) >= args.expected, (
"unexpected work items (got %d, expected at least %d)"
% (len(work_items), args.expected)
assert (
len(work_items) >= args.expected
), "unexpected work items (got %d, expected at least %d)" % (
len(work_items),
args.expected,
)

View File

@ -5,6 +5,7 @@
import json
from subprocess import check_call
from onefuzz.api import Onefuzz