Skip to content
Open
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
5 changes: 3 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ jobs:
strategy:
fail-fast: false
matrix:
task: [data-check, codespell]
#spellintian, nosetests, karma, lint, closure-compiler,
task: [nosetests, data-check, codespell]
#spellintian, karma, lint, closure-compiler,
steps:
- uses: actions/checkout@master
- name: Install dependencies
env:
TASK: ${{ matrix.task }}
run: |
if [ "$TASK" = "nosetests" ]; then pip install pynose; fi
if [ "$TASK" = "nosetests" -o "$TASK" = "flake8" -o "$TASK" = "flake8-wip" ]; then pip install json-spec; fi
if [ "$TASK" = "karma" -o "$TASK" = "lint" -o "$TASK" = "closure-compiler" ]; then npm install -g grunt-cli; fi
if [ "$TASK" = "karma" -o "$TASK" = "lint" -o "$TASK" = "closure-compiler" ]; then npm install; fi
Expand Down
3 changes: 2 additions & 1 deletion data/controller_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ class TestControllerData(unittest.TestCase):
def setUp(self):
globals = {}
locals = {}
execfile("data/controller_data.py", globals, locals)
# Python 2 and 3 compatible version of execfile
exec(open("data/controller_data.py").read(), globals, locals)
self.data = locals['CONTROLLER_DATA']

def test_ControllerData(self):
Expand Down
26 changes: 13 additions & 13 deletions data/manufacturer_links.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
(0x00A2, "http://www.empdesigns.co.uk/"),
(0x00A7, "https://www.syncronorm.com/"),
(0x00A8, "https://www.eye.co.jp/"),
(0x00A9, "http://www.richter-lt.de"),
(0x00B0, "http://www.arenaluci.com/"),
(0x00B9, "http://en.gzsjlight.com/"),
(0x00A9, "http://www.richter-lt.de/"),
(0x00B0, "https://arenaluci.it/en/"),
# (0x00B9, "http://en.gzsjlight.com/"), # Website currently gone
(0x0104, "https://www.blizzardpro.com/"),
(0x01CC, "https://portmanlights.com/"),
(0x01CD, "http://www.compulite.com/"),
Expand All @@ -52,7 +52,7 @@
(0x056B, "https://www.cosmolight.it/"),
(0x056C, "https://lumascape.com/"),
(0x05E0, "https://github.com/someweisguy/esp_dmx"),
(0x0609, "https://www.pierlite.com.au/diginet"),
(0x0609, "https://pierlite.com.au/our-brands/diginet"),
(0x06E4, "https://www.dydell.com/"),
(0x0710, "https://dts-lighting.it/"),
(0x074F, "https://www.panasonic.com/"),
Expand All @@ -70,7 +70,7 @@
(0x08A4, "https://www.adamhall.com/"),
(0x08A6, "https://impulswerk.de"),
(0x08EA, "https://www.cedarled.com/"),
(0x08C5, "https://ehrgeiz.glp.de/"),
# (0x08C5, "https://ehrgeiz.glp.de/"), # Now part of GLP
(0x0956, "https://www.expromo.eu/"),
(0x0957, "https://www.whitelight.ltd.uk/"),
(0x0960, "https://fineline.solutions/"),
Expand Down Expand Up @@ -134,17 +134,17 @@
(0x4C73, "http://www.lsclighting.com/"),
(0x4D41, "http://www.malighting.com/"),
(0x4D44, "https://www.mdgfog.com/"),
(0x4D50, "http://www.martin.com/"),
(0x4D56, "http://www.avolites.com/"),
(0x4D50, "https://www.martin.com/"),
(0x4D56, "https://www.avolites.com/"),
(0x4F43, "https://www.offstagecontrols.com/"),
(0x5000, "http://www.orangepi-dmx.org"),
(0x5041, "http://www.lighting.philips.com/"),
(0x5075, "http://pulsarlight.com/"),
# (0x5075, "http://pulsarlight.com/"), # Website has gone
(0x5100, "https://www.luxibel.com/"),
(0x514D, "http://www.qmaxz.com/"),
(0x5168, "http://www.sunricher.com"),
# (0x514D, "http://www.qmaxz.com/"), # Website had gone
(0x5168, "https://www.sunricher.com"),
(0x5201, "https://www.crestron.com/"),
(0x5252, "http://www.rosco.com/"),
(0x5252, "https://www.rosco.com/"),
(0x5253, "https://www.robe.cz/"),
(0x5343, "https://www.oceaninsight.com/"),
(0x5344, "https://www.stardraw.com/"),
Expand All @@ -157,11 +157,11 @@
(0x544C, "http://tempest.biz/"),
(0x564C, "http://www.vari-lite.com/"),
(0x5753, "http://wirelessdmx.com"),
(0x5759, "https://www.wybron.com/"),
# (0x5759, "https://www.wybron.com/"), # Company, and website has gone
(0x586D, "http://www.doityourselfchristmas.com/"),
(0x6019, "https://artificers.co.uk/"),
(0x6205, "http://www.ltechonline.com/"),
(0x6364, "http://www.lanbox.com/"),
# (0x6364, "http://www.lanbox.com/"), # Website has gone
(0x646F, "https://www.eldoled.com/"),
(0x6555, "https://shanteacontrols.com/"),
(0x656C, "https://www.elclighting.com/"),
Expand Down
41 changes: 33 additions & 8 deletions data/manufacturer_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,45 @@
# Copyright (C) 2015 Simon Newton

import unittest
import urllib2
import pprint
import sys
from socket import error as SocketError
from urllib2 import HTTPError
from urllib2 import URLError
from ssl import SSLError

if sys.version_info >= (3, 0):
try:
from urllib.request import build_opener
from urllib.request import HTTPCookieProcessor
from urllib.request import Request
from urllib.error import HTTPError
from urllib.error import URLError
except ImportError:
import urllib2
from urllib2 import build_opener
from urllib2 import HTTPCookieProcessor
from urllib2 import Request
from urllib2 import HTTPError
from urllib2 import URLError
else:
import urllib2
from urllib2 import build_opener
from urllib2 import HTTPCookieProcessor
from urllib2 import Request
from urllib2 import HTTPError
from urllib2 import URLError

class TestManufacturers(unittest.TestCase):
""" Test the manufacturer data files are valid."""
def setUp(self):
globals = {}
locals = {}
execfile("data/manufacturer_data.py", globals, locals)
# Python 2 and 3 compatible version of execfile
exec(open("data/manufacturer_data.py").read(), globals, locals)
self.data = locals['MANUFACTURER_DATA']
globals = {}
locals = {}
execfile("data/manufacturer_links.py", globals, locals)
# Python 2 and 3 compatible version of execfile
exec(open("data/manufacturer_links.py").read(), globals, locals)
self.links = locals['MANUFACTURER_LINKS']

def test_ManufacturerData(self):
Expand Down Expand Up @@ -64,7 +85,7 @@ def test_ManufacturerLinks(self):
esta_id, name = manufacturer_data
esta_ids.add(esta_id)

opener = urllib2.build_opener(urllib2.HTTPCookieProcessor())
opener = build_opener(HTTPCookieProcessor())

for manufacturer_link in self.links:
self.assertEqual(tuple, type(manufacturer_link))
Expand All @@ -90,7 +111,7 @@ def test_ManufacturerLinks(self):
ua = {'User-Agent': 'Mozilla/5.0 (KHTML, like Gecko)',
'referer': 'http://example.com'}

request = urllib2.Request(link, headers=ua)
request = Request(link, headers=ua)
response = opener.open(request)
except URLError as e:
if hasattr(e, 'reason'):
Expand All @@ -108,7 +129,11 @@ def test_ManufacturerLinks(self):
(type(e) is HTTPError and
(link == 'http://www.compulite.com/' or
link == 'https://www.lutron.com/en-US/Pages/default.aspx' or
link == 'https://www.panasonic.com/'))):
link == 'https://www.panasonic.com/' or
link == 'https://www.acuitybrands.com/' or
link == 'https://www.nxp.com/' or
link == 'https://www.martin.com/' or
link == 'https://www.productionwarehouse.co.za/'))):
self.fail("Link %s failed due to %s, reason type: %s" % (link, e.reason, type(e)))
elif hasattr(e, 'code'):
self.fail("The server couldn't fulfill the request for %s. Error "
Expand Down
3 changes: 2 additions & 1 deletion data/model_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ class TestDeviceModelData(unittest.TestCase):
def setUp(self):
globals = {}
locals = {}
execfile("data/model_data.py", globals, locals)
# Python 2 and 3 compatible version of execfile
exec(open("data/model_data.py").read(), globals, locals)
self.data = locals['DEVICE_MODEL_DATA']

def test_DeviceModelData(self):
Expand Down
3 changes: 2 additions & 1 deletion data/node_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ class TestNodeData(unittest.TestCase):
def setUp(self):
globals = {}
locals = {}
execfile("data/node_data.py", globals, locals)
# Python 2 and 3 compatible version of execfile
exec(open("data/node_data.py").read(), globals, locals)
self.data = locals['NODE_DATA']

def test_NodeData(self):
Expand Down
3 changes: 2 additions & 1 deletion data/pid_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,8 @@ class TestPidData(unittest.TestCase):
def setUp(self):
globals = {}
locals = {}
execfile("data/pid_data.py", globals, locals)
# Python 2 and 3 compatible version of execfile
exec(open("data/pid_data.py").read(), globals, locals)
self.manufacturer_pids = locals['MANUFACTURER_PIDS']
self.esta_pids = locals['ESTA_PIDS']
self.pid_validator = jsonspec.validators.load(PID_VALIDATOR)
Expand Down
3 changes: 2 additions & 1 deletion data/product_category_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ class TestProductCategoryData(unittest.TestCase):
def setUp(self):
globals = {}
locals = {}
execfile("data/product_categories.py", globals, locals)
# Python 2 and 3 compatible version of execfile
exec(open("data/product_categories.py").read(), globals, locals)
self.data = locals['PRODUCT_CATEGORIES']

def test_ProductCategoryData(self):
Expand Down
3 changes: 2 additions & 1 deletion data/sensor_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ class TestSensorTypes(unittest.TestCase):
def setUp(self):
globals = {}
locals = {}
execfile("data/sensor_types.py", globals, locals)
# Python 2 and 3 compatible version of execfile
exec(open("data/sensor_types.py").read(), globals, locals)
self.data = locals['SENSOR_TYPES']

def test_SensorTypeData(self):
Expand Down
3 changes: 2 additions & 1 deletion data/software_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ class TestSoftwareData(unittest.TestCase):
def setUp(self):
globals = {}
locals = {}
execfile("data/software_data.py", globals, locals)
# Python 2 and 3 compatible version of execfile
exec(open("data/software_data.py").read(), globals, locals)
self.data = locals['SOFTWARE_DATA']

def test_SoftwareData(self):
Expand Down
3 changes: 2 additions & 1 deletion data/splitter_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ class TestSplitterData(unittest.TestCase):
def setUp(self):
globals = {}
locals = {}
execfile("data/splitter_data.py", globals, locals)
# Python 2 and 3 compatible version of execfile
exec(open("data/splitter_data.py").read(), globals, locals)
self.data = locals['SPLITTER_DATA']

def test_SplitterData(self):
Expand Down
6 changes: 4 additions & 2 deletions tools/missing_manufacturer_links.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,13 @@ def Footer():
if __name__ == '__main__':
globals = {}
locals = {}
execfile("data/manufacturer_data.py", globals, locals)
# Python 2 and 3 compatible version of execfile
exec(open("data/manufacturer_data.py").read(), globals, locals)
raw_manufacturers = locals['MANUFACTURER_DATA']
globals = {}
locals = {}
execfile("data/manufacturer_links.py", globals, locals)
# Python 2 and 3 compatible version of execfile
exec(open("data/manufacturer_links.py").read(), globals, locals)
raw_links = locals['MANUFACTURER_LINKS']

manufacturers = {}
Expand Down
Loading