> > When trying to run the tests on linux I get the following import error:
> >
> > *** Running GTK test suite for ubuntu_sso ***
>
> ...snip...
>
> > File "/home/mandel/Projects/Canonical/ubuntu-sso-client/fix-networkstate-
> > darwin/ubuntu_sso/networkstate/darwin.py", line 55, in <module>
> > CFRunLoopGetCurrent = CoreFoundation.CFRunLoopGetCurrent
> > File "/usr/lib/python2.7/ctypes/__init__.py", line 378, in __getattr__
> > func = self.__getitem__(name)
> > File "/usr/lib/python2.7/ctypes/__init__.py", line 383, in __getitem__
> > func = self._FuncPtr((name_or_ordinal, self))
> > AttributeError: /usr/bin/python: undefined symbol: CFRunLoopGetCurrent
> >
> >
> > Probably there is a missing module in the list of ingored modules
>
> It's running the darwin tests. The prerequisite branch fixes this, and I've
> now merged with that branch with commit 970. Sorry for the inconvenience. I
> should've used the bzr pipeline plugin, I guess...
No worries about that is a small details. After merging the other branch I get the following lint errors:
ubuntu_sso/networkstate/darwin.py:
68: [C0301] Line too long (80/79)
253: [C0301] Line too long (81/79)
254: [C0301] Line too long (82/79)
51: [C0103] Invalid name "CoreFoundationPath" (should match (([A-Z_][A-Z0-9_]*)|(__.*__))$)
52: [C0103] Invalid name "CoreFoundation" (should match (([A-Z_][A-Z0-9_]*)|(__.*__))$)
55: [C0103] Invalid name "CFRunLoopGetCurrent" (should match (([A-Z_][A-Z0-9_]*)|(__.*__))$)
60: [C0103] Invalid name "CFRelease" (should match (([A-Z_][A-Z0-9_]*)|(__.*__))$)
65: [C0103] Invalid name "CFRunLoopRun" (should match (([A-Z_][A-Z0-9_]*)|(__.*__))$)
68: [C0103] Invalid name "kCFRunLoopDefaultMode" (should match (([A-Z_][A-Z0-9_]*)|(__.*__))$)
68: [E1101] Class 'c_void_p' has no 'in_dll' member
73: [C0103] Invalid name "SystemConfigurationPath" (should match (([A-Z_][A-Z0-9_]*)|(__.*__))$)
82: [C0103] Invalid name "SCNRCreateWithName" (should match (([A-Z_][A-Z0-9_]*)|(__.*__))$)
87: [C0103] Invalid name "SCNRGetFlags" (should match (([A-Z_][A-Z0-9_]*)|(__.*__))$)
92: [C0103] Invalid name "SCNRScheduleWithRunLoop" (should match (([A-Z_][A-Z0-9_]*)|(__.*__))$)
102: [C0103] Invalid name "SCNRCallbackType" (should match (([A-Z_][A-Z0-9_]*)|(__.*__))$)
108: [C0103] Invalid name "SCNRSetCallback" (should match (([A-Z_][A-Z0-9_]*)|(__.*__))$)
115: [C0111, _check_connected_state] Missing docstring
145: [C0103, flags_say_reachable] Invalid name "kReachable" (should match [a-z_][a-z0-9_]{1,30}$)
146: [C0103, flags_say_reachable] Invalid name "kConnectionRequired" (should match [a-z_][a-z0-9_]{1,30}$)
270: [W0612, NetworkManagerState.find_online_state] Unused variable 'e'
282: [W0703, is_machine_connected] Catching too general exception Exception
23: [W0611] Unused import NM_STATE_DISCONNECTED_LIST
30: [W0611] Unused import NM_STATE_CONNECTED_GLOBAL
23: [W0611] Unused import NM_STATE_CONNECTED_LIST
23: [W0611] Unused import NM_STATE_CONNECTING_LIST
ubuntu_sso/networkstate/networkstates.py:
18: [C0111, NetworkState] Missing docstring
20: [C0322, NetworkState.__init__] Operator not preceded by a space self.label=label ^
ubuntu_sso/networkstate/tests/run-nwmgr-standalone.py:
1: [C0103] Invalid name "run-nwmgr-standalone" (should match (([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$)
1: [C0111] Missing docstring
5: [C0111, my_cb] Missing docstring
12: [C0103] Invalid name "nms" (should match (([A-Z_][A-Z0-9_]*)|(__.*__))$)
ubuntu_sso/networkstate/tests/test_darwin.py:
80: [C0301] Line too long (83/79)
57: [C0103] Invalid name "test_kReachable" (should match (([A-Z_][A-Z0-9_]*)|(__.*__))$)
58: [C0103] Invalid name "test_kConnectionRequired" (should match (([A-Z_][A-Z0-9_]*)|(__.*__))$)
72: [W0212, TestSCNRFailingInDirect.test_cant_create_target] Access to a protected member _check_connected_state of a client class
82: [W0212, TestSCNRFailingInDirect.test_cant_get_flags] Access to a protected member _check_connected_state of a client class
90: [C0103, TestFailingSCNRInCallbacks.expectUNKNOWN] Invalid name "expectUNKNOWN" (should match ([a-z_][a-z0-9_]{2,79}$|setUp|tearDown))
98: [C0111, TestFailingSCNRInCallbacks.test_exc_in_find_online_state.f] Missing docstring
101: [W0612, TestFailingSCNRInCallbacks.test_exc_in_find_online_state] Unused variable 'nms'
109: [W0212, TestFailingSCNRInCallbacks.test_cant_create_target] Access to a protected member _listen_on_separate_thread of a client class
117: [W0212, TestFailingSCNRInCallbacks.test_cant_set_callback] Access to a protected member _listen_on_separate_thread of a client class
126: [W0212, TestFailingSCNRInCallbacks.test_cant_schedule_with_runloop] Access to a protected member _listen_on_separate_thread of a client class
133: [E0602, TestReadingFlags.setUp] Undefined variable 'TestFlagsReading'
135: [C0103, TestReadingFlags.test_flag_kReachable] Invalid name "test_flag_kReachable" (should match ([a-z_][a-z0-9_]{2,79}$|setUp|tearDown))
140: [C0103, TestReadingFlags.test_flag_kReachable_and_kConnectionRequired] Invalid name "test_flag_kReachable_and_kConnectionRequired" (should match ([a-z_][a-z0-9_]{2,79}$|setUp|tearDown))
176: [W0212, TestNMSListeningForNWStateChanges.test_network_state_change] Access to a protected member _state_changed of a client class
177: [W0212, TestNMSListeningForNWStateChanges.test_network_state_change] Access to a protected member _state_changed of a client class
178: [W0212, TestNMSListeningForNWStateChanges.test_network_state_change] Access to a protected member _state_changed of a client class
189: [C0103, TestIsMachineConnectedFunc.test_not_connected_returns_False] Invalid name "test_not_connected_returns_False" (should match ([a-z_][a-z0-9_]{2,79}$|setUp|tearDown))
189: [C0111, TestIsMachineConnectedFunc.test_not_connected_returns_False] Missing docstring
196: [C0103, TestIsMachineConnectedFunc.test_connected_returns_True] Invalid name "test_connected_returns_True" (should match ([a-z_][a-z0-9_]{2,79}$|setUp|tearDown))
196: [C0111, TestIsMachineConnectedFunc.test_connected_returns_True] Missing docstring
31: [W0611] Unused import defaultdict
34: [W0611] Unused import ARGS
34: [W0611] Unused import KWARGS
34: [W0611] Unused import MockerTestCase
34: [W0611] Unused import ANY
Lint is run even for the paths that are ignore to ensure that we do maintain a good code quality.
> > When trying to run the tests on linux I get the following import error: mandel/ Projects/ Canonical/ ubuntu- sso-client/ fix-networkstat e- ubuntu_ sso/networkstat e/darwin. py", line 55, in <module> CFRunLoopGetCur rent python2. 7/ctypes/ __init_ _.py", line 378, in __getattr__ getitem_ _(name) python2. 7/ctypes/ __init_ _.py", line 383, in __getitem__ (name_or_ ordinal, self))
> >
> > *** Running GTK test suite for ubuntu_sso ***
>
> ...snip...
>
> > File "/home/
> > darwin/
> > CFRunLoopGetCurrent = CoreFoundation.
> > File "/usr/lib/
> > func = self.__
> > File "/usr/lib/
> > func = self._FuncPtr(
> > AttributeError: /usr/bin/python: undefined symbol: CFRunLoopGetCurrent
> >
> >
> > Probably there is a missing module in the list of ingored modules
>
> It's running the darwin tests. The prerequisite branch fixes this, and I've
> now merged with that branch with commit 970. Sorry for the inconvenience. I
> should've used the bzr pipeline plugin, I guess...
No worries about that is a small details. After merging the other branch I get the following lint errors:
ubuntu_ sso/networkstat e/darwin. py: Path" (should match (([A-Z_ ][A-Z0- 9_]*)|( __.*__) )$) ][A-Z0- 9_]*)|( __.*__) )$) rrent" (should match (([A-Z_ ][A-Z0- 9_]*)|( __.*__) )$) ][A-Z0- 9_]*)|( __.*__) )$) ][A-Z0- 9_]*)|( __.*__) )$) ultMode" (should match (([A-Z_ ][A-Z0- 9_]*)|( __.*__) )$) ationPath" (should match (([A-Z_ ][A-Z0- 9_]*)|( __.*__) )$) Name" (should match (([A-Z_ ][A-Z0- 9_]*)|( __.*__) )$) ][A-Z0- 9_]*)|( __.*__) )$) thRunLoop" (should match (([A-Z_ ][A-Z0- 9_]*)|( __.*__) )$) ][A-Z0- 9_]*)|( __.*__) )$) ][A-Z0- 9_]*)|( __.*__) )$) connected_ state] Missing docstring reachable] Invalid name "kReachable" (should match [a-z_][ a-z0-9_ ]{1,30} $) reachable] Invalid name "kConnectionReq uired" (should match [a-z_][ a-z0-9_ ]{1,30} $) tate.find_ online_ state] Unused variable 'e' connected] Catching too general exception Exception DISCONNECTED_ LIST CONNECTED_ GLOBAL CONNECTED_ LIST CONNECTING_ LIST
68: [C0301] Line too long (80/79)
253: [C0301] Line too long (81/79)
254: [C0301] Line too long (82/79)
51: [C0103] Invalid name "CoreFoundation
52: [C0103] Invalid name "CoreFoundation" (should match (([A-Z_
55: [C0103] Invalid name "CFRunLoopGetCu
60: [C0103] Invalid name "CFRelease" (should match (([A-Z_
65: [C0103] Invalid name "CFRunLoopRun" (should match (([A-Z_
68: [C0103] Invalid name "kCFRunLoopDefa
68: [E1101] Class 'c_void_p' has no 'in_dll' member
73: [C0103] Invalid name "SystemConfigur
82: [C0103] Invalid name "SCNRCreateWith
87: [C0103] Invalid name "SCNRGetFlags" (should match (([A-Z_
92: [C0103] Invalid name "SCNRScheduleWi
102: [C0103] Invalid name "SCNRCallbackType" (should match (([A-Z_
108: [C0103] Invalid name "SCNRSetCallback" (should match (([A-Z_
115: [C0111, _check_
145: [C0103, flags_say_
146: [C0103, flags_say_
270: [W0612, NetworkManagerS
282: [W0703, is_machine_
23: [W0611] Unused import NM_STATE_
30: [W0611] Unused import NM_STATE_
23: [W0611] Unused import NM_STATE_
23: [W0611] Unused import NM_STATE_
ubuntu_ sso/networkstat e/networkstates .py: __init_ _] Operator not preceded by a space
self. label=label
^
18: [C0111, NetworkState] Missing docstring
20: [C0322, NetworkState.
ubuntu_ sso/networkstat e/tests/ run-nwmgr- standalone. py: standalone" (should match (([a-z_ ][a-z0- 9_]*)|( [A-Z][a- zA-Z0-9] +))$) ][A-Z0- 9_]*)|( __.*__) )$)
1: [C0103] Invalid name "run-nwmgr-
1: [C0111] Missing docstring
5: [C0111, my_cb] Missing docstring
12: [C0103] Invalid name "nms" (should match (([A-Z_
ubuntu_ sso/networkstat e/tests/ test_darwin. py: ][A-Z0- 9_]*)|( __.*__) )$) onRequired" (should match (([A-Z_ ][A-Z0- 9_]*)|( __.*__) )$) InDirect. test_cant_ create_ target] Access to a protected member _check_ connected_ state of a client class InDirect. test_cant_ get_flags] Access to a protected member _check_ connected_ state of a client class InCallbacks. expectUNKNOWN] Invalid name "expectUNKNOWN" (should match ([a-z_] [a-z0-9_ ]{2,79} $|setUp| tearDown) ) InCallbacks. test_exc_ in_find_ online_ state.f] Missing docstring InCallbacks. test_exc_ in_find_ online_ state] Unused variable 'nms' InCallbacks. test_cant_ create_ target] Access to a protected member _listen_ on_separate_ thread of a client class InCallbacks. test_cant_ set_callback] Access to a protected member _listen_ on_separate_ thread of a client class InCallbacks. test_cant_ schedule_ with_runloop] Access to a protected member _listen_ on_separate_ thread of a client class s.setUp] Undefined variable 'TestFlagsReading' s.test_ flag_kReachable ] Invalid name "test_flag_ kReachable" (should match ([a-z_] [a-z0-9_ ]{2,79} $|setUp| tearDown) ) s.test_ flag_kReachable _and_kConnectio nRequired] Invalid name "test_flag_ kReachable_ and_kConnection Required" (should match ([a-z_] [a-z0-9_ ]{2,79} $|setUp| tearDown) ) gForNWStateChan ges.test_ network_ state_change] Access to a protected member _state_changed of a client class gForNWStateChan ges.test_ network_ state_change] Access to a protected member _state_changed of a client class gForNWStateChan ges.test_ network_ state_change] Access to a protected member _state_changed of a client class nnectedFunc. test_not_ connected_ returns_ False] Invalid name "test_not_ connected_ returns_ False" (should match ([a-z_] [a-z0-9_ ]{2,79} $|setUp| tearDown) ) nnectedFunc. test_not_ connected_ returns_ False] Missing docstring nnectedFunc. test_connected_ returns_ True] Invalid name "test_connected _returns_ True" (should match ([a-z_] [a-z0-9_ ]{2,79} $|setUp| tearDown) ) nnectedFunc. test_connected_ returns_ True] Missing docstring
80: [C0301] Line too long (83/79)
57: [C0103] Invalid name "test_kReachable" (should match (([A-Z_
58: [C0103] Invalid name "test_kConnecti
72: [W0212, TestSCNRFailing
82: [W0212, TestSCNRFailing
90: [C0103, TestFailingSCNR
98: [C0111, TestFailingSCNR
101: [W0612, TestFailingSCNR
109: [W0212, TestFailingSCNR
117: [W0212, TestFailingSCNR
126: [W0212, TestFailingSCNR
133: [E0602, TestReadingFlag
135: [C0103, TestReadingFlag
140: [C0103, TestReadingFlag
176: [W0212, TestNMSListenin
177: [W0212, TestNMSListenin
178: [W0212, TestNMSListenin
189: [C0103, TestIsMachineCo
189: [C0111, TestIsMachineCo
196: [C0103, TestIsMachineCo
196: [C0111, TestIsMachineCo
31: [W0611] Unused import defaultdict
34: [W0611] Unused import ARGS
34: [W0611] Unused import KWARGS
34: [W0611] Unused import MockerTestCase
34: [W0611] Unused import ANY
Lint is run even for the paths that are ignore to ensure that we do maintain a good code quality.