def test_discover_external_namespaces_error(self, readlink, filter): readlink.side_effect = ['net:[4026531956]', OSError()] filter.return_value = ['1'] ns = discover_external_namespaces() self.assertFalse(('1', 'net:[4026531956]') in ns) self.assertEqual([], ns)
def test_discover_external_namespaces(self, readlink, filter): readlink.side_effect = ['net:[4026531956]', 'net:[4026531956]', 'net:[12345]'] filter.return_value = ['1', '2'] ns = discover_external_namespaces() self.assertFalse(('1', 'net:[4026531956]') in ns) self.assertTrue(('2', 'net:[12345]') in ns)