Package: ryu / 4.26+dfsg1-5

remove-test-requirements-units.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
Description: Remove test_requirements.py file
 This unit test is doing network access, which we don't want in the context
 of Debian package build.
Author: Thomas Goirand <zigo@debian.org>
Forwarded: no
Last-Update: 2018-02-16

--- a/ryu/tests/unit/test_requirements.py	2018-02-16 16:23:17.620509503 +0000
+++ /dev/null	2017-10-16 21:43:57.398818308 +0000
@@ -1,85 +0,0 @@
-# Copyright (C) 2016 Nippon Telegraph and Telephone Corporation.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#    http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-# implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-import logging
-import os
-import sys
-import unittest
-
-import pkg_resources
-from six.moves import urllib
-
-from nose.tools import ok_
-
-
-LOG = logging.getLogger(__name__)
-
-MOD_DIR = os.path.dirname('file://' + sys.modules[__name__].__file__)
-_RYU_REQUIREMENTS_FILES = [
-    '../../../tools/pip-requires',
-    '../../../tools/optional-requires',
-]
-RYU_REQUIREMENTS_FILES = [
-    os.path.join(MOD_DIR, f) for f in _RYU_REQUIREMENTS_FILES]
-
-OPENSTACK_REQUIREMENTS_REPO = 'https://github.com/openstack/requirements'
-OPENSTACK_REQUIREMENTS_URL = (
-    'https://github.com/openstack/requirements/raw/master/')
-_OPENSTACK_REQUIREMENTS_FILES = [
-    'requirements.txt',
-    'global-requirements.txt',
-]
-OPENSTACK_REQUIREMENTS_FILES = [
-    urllib.parse.urljoin(OPENSTACK_REQUIREMENTS_URL, f)
-    for f in _OPENSTACK_REQUIREMENTS_FILES]
-
-
-def _get_requirements(files):
-    requirements = {}
-    for f in files:
-        response = urllib.request.urlopen(f)
-        contents = response.read().decode('utf-8')
-        for r in pkg_resources.parse_requirements(contents):
-            requirements[r.name] = str(r)
-
-    return requirements
-
-
-OPENSTACK_REQUIREMENTS = _get_requirements(OPENSTACK_REQUIREMENTS_FILES)
-RYU_REQUIREMENTS = _get_requirements(RYU_REQUIREMENTS_FILES)
-
-
-class TestRequirements(unittest.TestCase):
-    """
-    Test whether the requirements of Ryu has no conflict with that
-    of other projects.
-    """
-
-    def setUp(self):
-        pass
-
-    def tearDown(self):
-        pass
-
-    def test_with_openstack_requirements(self):
-        try:
-            for name, req in OPENSTACK_REQUIREMENTS.items():
-                if name in RYU_REQUIREMENTS:
-                    ok_(pkg_resources.require(req))
-        except pkg_resources.VersionConflict as e:
-            LOG.exception(
-                'Some requirements of Ryu are conflicting with that of '
-                'OpenStack project: %s', OPENSTACK_REQUIREMENTS_REPO)
-            raise e