-
Notifications
You must be signed in to change notification settings - Fork 12
Run Nosetests via GitHub Actions #332
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
base: master
Are you sure you want to change the base?
Changes from all commits
17646ea
95748d4
89d50fa
7279223
9b793c0
28a7dc5
6530b0b
5c14373
2178e13
cd8b781
c45cebb
494c3c8
e945c8c
6445fec
4db2ae3
67cce8c
fc0aeda
6a20f21
29eb495
8f723d7
3d7a58a
0897b21
dfc61fd
eed3831
cb11fcf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we have an automatic test for that? Or do you manually check them from time to time?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh ok, I see the Python script for that down below. Solved. |
||
| (0x0104, "https://www.blizzardpro.com/"), | ||
| (0x01CC, "https://portmanlights.com/"), | ||
| (0x01CD, "http://www.compulite.com/"), | ||
|
|
@@ -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/"), | ||
|
|
@@ -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/"), | ||
|
|
@@ -134,17 +134,17 @@ | |
| (0x4C73, "http://www.lsclighting.com/"), | ||
| (0x4D41, "http://www.malighting.com/"), | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably should be |
||
| (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/"), | ||
|
|
@@ -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/"), | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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): | ||
|
|
@@ -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)) | ||
|
|
@@ -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'): | ||
|
|
@@ -108,7 +129,14 @@ 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://portmanlights.com/' or | ||
| link == 'https://www.adamhall.com/')) or | ||
| (type(e) is URLError and | ||
| (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 " | ||
|
|
@@ -117,7 +145,7 @@ def test_ManufacturerLinks(self): | |
| if hasattr(e, 'errno'): | ||
| self.fail("Link %s failed due to socket error %s" % (link, e.errno)) | ||
| else: | ||
| self.assertEqual(response.code, 200, | ||
| self.assertTrue(((response.code == 200) or (response.code == 202)), | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is an HTTP 307 also a success? |
||
| "Failed to fetch URL %s got status %d" % | ||
| (link, response.code)) | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need Python2-compatibility in 2026 any more?