mirror of
https://github.com/BOSWatch/BW3-Core.git
synced 2026-01-11 11:10:08 +01:00
add comments
This commit is contained in:
parent
370ad5ac85
commit
e5141c186d
|
|
@ -31,6 +31,7 @@ def setup_method(method):
|
|||
|
||||
@pytest.fixture
|
||||
def makeDescriptor():
|
||||
"""!Build a descriptor object with loaded configuration"""
|
||||
config = ConfigYAML()
|
||||
assert config.loadConfigFile(paths.TEST_PATH + "test_config.yaml") is True
|
||||
descriptor = Descriptor(config.get("descriptor_test"))
|
||||
|
|
@ -39,23 +40,27 @@ def makeDescriptor():
|
|||
|
||||
@pytest.fixture
|
||||
def makePacket():
|
||||
"""!Build a BW Packet object"""
|
||||
packet = Packet()
|
||||
return packet
|
||||
|
||||
|
||||
def test_descriptorFoundFirst(makeDescriptor, makePacket):
|
||||
"""!Run descriptor on the first entry in list"""
|
||||
makePacket.set("tone", "12345")
|
||||
makePacket = makeDescriptor.doWork(makePacket)
|
||||
assert makePacket.get("description") == "Test 12345"
|
||||
|
||||
|
||||
def test_descriptorFoundSecond(makeDescriptor, makePacket):
|
||||
"""!Run descriptor on the second entry in list"""
|
||||
makePacket.set("tone", "23456")
|
||||
makePacket = makeDescriptor.doWork(makePacket)
|
||||
assert makePacket.get("description") == "Test 23456"
|
||||
|
||||
|
||||
def test_descriptorNotFound(makeDescriptor, makePacket):
|
||||
"""!Run descriptor on a non existent field"""
|
||||
makePacket.set("tone", "99999")
|
||||
makePacket = makeDescriptor.doWork(makePacket)
|
||||
assert makePacket.get("description") == "99999"
|
||||
|
|
|
|||
Loading…
Reference in a new issue