Skip to content

Commit

Permalink
basic item testing implemented
Browse files Browse the repository at this point in the history
  • Loading branch information
benne238 committed Jan 8, 2021
1 parent 15f9e4c commit 46807e9
Showing 1 changed file with 37 additions and 4 deletions.
41 changes: 37 additions & 4 deletions api/pytest/test_api_tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,40 @@ def test_ECNQueue_isValidItemName():
@pytest.mark.ECNQueue_Item
def test_ECNQueue_Item():

validQueues = ECNQueue.getValidQueues()

random.choice(validQueues)

# validQueues = ECNQueue.getValidQueues()

# Selects a random queue to be tested against
# testQueue = random.choice(validQueues)

item = ECNQueue.Item("ce", 100)

itemKeys = [
"queue",
"number",
"lastUpdated",
"headers",
"content",
"isLocked",
"userEmail",
"userName",
"userAlias",
"assignedTo",
"subject",
"status",
"priority",
"department",
"building",
"dateReceived",
"jsonData"
]

# Returns a list of all attributes in the item object
returnedItemKeys = item.__dict__

# Checks that all necessary keys are in the item
assert all(keys in itemKeys for keys in returnedItemKeys)

print()

if __name__ == "__main__":
test_ECNQueue_Item()

0 comments on commit 46807e9

Please sign in to comment.