Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dmm test cleanup #123

Merged
merged 3 commits into from
Dec 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ __pycache__
/.pytest_cache
/tests/archive
/BAC0/web/test
/venv/
12 changes: 7 additions & 5 deletions tests/test_1AddressesTypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
import BAC0
import pytest

VENDOR_ID = 842

@pytest.fixture(scope='session')
def host_ip():
hip = HostIP()
Expand All @@ -22,33 +24,33 @@ def host_ip():
def test_WithIPProvided(host_ip):
ip, subnet = host_ip
bacnet_with_ip = BAC0.lite(ip=ip,port=47812)
assert bacnet_with_ip.vendorId == 842
assert bacnet_with_ip.vendorId == VENDOR_ID
bacnet_with_ip.disconnect()

@pytest.mark.skip("Works locally but nt in Travis")
def test_WithIPAndMask(host_ip):
ip, subnet = host_ip
bacnet_with_ip = BAC0.lite(ip=ip, mask=subnet, port=47812)
assert bacnet_with_ip.vendorId == 842
assert bacnet_with_ip.vendorId == VENDOR_ID
bacnet_with_ip.disconnect()

@pytest.mark.skip("Works locally but not in Travis")
def test_WithIPAndMaskAndPort(host_ip):
ip, subnet = host_ip
bacnet_with_ip = BAC0.lite(ip=ip, mask=subnet, port=47812)
assert bacnet_with_ip.vendorId == 842
assert bacnet_with_ip.vendorId == VENDOR_ID
bacnet_with_ip.disconnect()

@pytest.mark.skip("Works locally but not in Travis")
def test_WithIPAndMaskInString(host_ip):
ip, subnet = host_ip
bacnet_with_ip = BAC0.lite(ip='{}/{}'.format(ip,subnet),port=47812)
assert bacnet_with_ip.vendorId == 842
assert bacnet_with_ip.vendorId == VENDOR_ID
bacnet_with_ip.disconnect()

@pytest.mark.skip("Works locally but not in Travis")
def test_WithIPAndMaskAndPortInString(host_ip):
ip, subnet = host_ip
bacnet_with_ip = BAC0.lite(ip='{}/{}:47812'.format(ip,subnet))
assert bacnet_with_ip.vendorId == 842
assert bacnet_with_ip.vendorId == VENDOR_ID
bacnet_with_ip.disconnect()
16 changes: 10 additions & 6 deletions tests/test_Read.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,34 @@
Test Bacnet communication with another device
"""

CHANGE_DELTA = 99.90
TOLERANCE = 0.01
BINARY_TEST_STATE = 'active'

def test_ReadAV(network_and_devices):
test_device = network_and_devices.test_device
assert (test_device['av0'] - 99.90) < 0.01
assert (test_device['av0'] - CHANGE_DELTA) < TOLERANCE

def test_ReadMV(network_and_devices):
test_device = network_and_devices.test_device
assert test_device['mv0'].value == 1

def test_ReadBV(network_and_devices):
test_device = network_and_devices.test_device
assert test_device['bv0'].value == 'active'
assert test_device['bv0'].value == BINARY_TEST_STATE

def test_ReadAI(network_and_devices):
test_device = network_and_devices.test_device
assert (test_device['ai0'] - 99.90) < 0.01
assert (test_device['ai0'] - CHANGE_DELTA) < TOLERANCE

def test_ReadAO(network_and_devices):
test_device = network_and_devices.test_device
assert (test_device['ao0'] - 99.90) < 0.01
assert (test_device['ao0'] - CHANGE_DELTA) < TOLERANCE

def test_ReadBI(network_and_devices):
test_device = network_and_devices.test_device
assert test_device['bi0'].value == 'active'
assert test_device['bi0'].value == BINARY_TEST_STATE

def test_ReadBO(network_and_devices):
test_device = network_and_devices.test_device
assert test_device['bo0'].value == 'active'
assert test_device['bo0'].value == BINARY_TEST_STATE
23 changes: 0 additions & 23 deletions tests/wait_bacpypes_0176_test_Segmentation_300objects.py

This file was deleted.