Skip to content

Commit

Permalink
basic test for ECNQueue.getValidQueues()
Browse files Browse the repository at this point in the history
  • Loading branch information
benne238 committed Jan 6, 2021
1 parent 444fb42 commit 2c8219c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
21 changes: 21 additions & 0 deletions api/pytest/test_api_tester.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#Importing pytest is not required unless using markers, as demonstrated below
import pytest
import ECNQueue

@pytest.mark.getValidQueuesTest
def test_item():
queueCounts = ECNQueue.getQueueCounts()

# Ensure that getQueueCounts() within ECNQueue returns a list
assert type(queueCounts) is list

# Ensure that getQueueCounts() within ECNQueue returns a list of dictionaries with this syntax:

# {'name': '_string'
# 'number_of_items': _int}
for queue in queueCounts:
assert type(queue) is dict
assert "name" in queue.keys()
assert type(queue['name']) is str
assert "number_of_items" in queue.keys()
assert type(queue['number_of_items']) is int
5 changes: 5 additions & 0 deletions api/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from distutils.core import setup

setup(name='ApiECNQueue',
py_modules=['api', 'ECNQueue',],
)

0 comments on commit 2c8219c

Please sign in to comment.