Code review comment for lp:~mikemc/ubuntu-sso-client/fix-networkstate-darwin

Revision history for this message
Manuel de la Peña (mandel) wrote :

> > 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.

review: Needs Fixing

« Back to merge proposal