Copyright Messages Cleanup 73/30973/2
authorIkram Ikramullah <ikram@research.att.com>
Fri, 9 Feb 2018 04:29:04 +0000 (23:29 -0500)
committerIkram Ikramullah <ikram@research.att.com>
Fri, 9 Feb 2018 04:44:37 +0000 (23:44 -0500)
Tox and pep8 failed due to multiple reason causing
our verify-python jobs to fail. One reason being the
failure of test cases. Added sample test case for
developers to follow. Another reason was the Copyright
message appearing in supposedly empty package files.
Removed copyright messages so pep8 can succeed.

Issue-ID: OPTFRA-78
Change-Id: If7e4b28e2dabdba194e31a67da4647a342a7630f
Signed-off-by: Ikram Ikramullah <ikram@research.att.com>
29 files changed:
conductor/conductor/api/controllers/root.py
conductor/conductor/api/controllers/v1/__init__.py
conductor/conductor/cmd/__init__.py
conductor/conductor/common/music/model/__init__.py
conductor/conductor/conf/__init__.py
conductor/conductor/data/plugins/__init__.py
conductor/conductor/data/plugins/inventory_provider/__init__.py
conductor/conductor/data/plugins/service_controller/__init__.py
conductor/conductor/solver/optimizer/__init__.py
conductor/conductor/solver/optimizer/constraints/__init__.py
conductor/conductor/solver/request/__init__.py
conductor/conductor/solver/request/functions/__init__.py
conductor/conductor/solver/request/functions/cloud_version.py
conductor/conductor/solver/request/functions/distance_between.py
conductor/conductor/solver/request/parser.py
conductor/conductor/solver/resource/__init__.py
conductor/conductor/solver/service.py
conductor/conductor/solver/simulators/__init__.py
conductor/conductor/solver/simulators/a_and_ai/__init__.py
conductor/conductor/solver/simulators/valet/__init__.py
conductor/conductor/solver/utils/__init__.py
conductor/conductor/tests/__init__.py
conductor/conductor/tests/functional/__init__.py
conductor/conductor/tests/integration/__init__.py
conductor/conductor/tests/tempest/__init__.py [deleted file]
conductor/conductor/tests/unit/__init__.py
conductor/conductor/tests/unit/test_aai.py [new file with mode: 0644]
conductor/conductor/tests/unit/test_sample.py [new file with mode: 0644]
conductor/tox.ini

index d7c4a7e..abf3f20 100644 (file)
@@ -50,7 +50,8 @@ def version_descriptor(base_url, version, released_on):
         'id': version,
         'links': [
             {'href': url, 'rel': 'self', },
-            {'href': 'https://wiki.onap.org/pages/viewpage.action?pageId=16005528',
+            {'href': 'https://wiki.onap.org/pages'
+                     '/viewpage.action?pageId=16005528',
              'rel': 'describedby', 'type': 'text/html', }],
         'media-types': [
             {'base': 'application/json', 'type': MEDIA_TYPE_JSON % version, }],
index 51efce1..e69de29 100644 (file)
@@ -1,18 +0,0 @@
-#
-# -------------------------------------------------------------------------
-#   Copyright (c) 2015-2017 AT&T Intellectual Property
-#
-#   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.
-#
-# -------------------------------------------------------------------------
-#
index 51efce1..e69de29 100644 (file)
@@ -1,18 +0,0 @@
-#
-# -------------------------------------------------------------------------
-#   Copyright (c) 2015-2017 AT&T Intellectual Property
-#
-#   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.
-#
-# -------------------------------------------------------------------------
-#
index f2bbdfd..e69de29 100644 (file)
@@ -1,19 +0,0 @@
-#
-# -------------------------------------------------------------------------
-#   Copyright (c) 2015-2017 AT&T Intellectual Property
-#
-#   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.
-#
-# -------------------------------------------------------------------------
-#
-
index 51efce1..e69de29 100644 (file)
@@ -1,18 +0,0 @@
-#
-# -------------------------------------------------------------------------
-#   Copyright (c) 2015-2017 AT&T Intellectual Property
-#
-#   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.
-#
-# -------------------------------------------------------------------------
-#
index 51efce1..e69de29 100644 (file)
@@ -1,18 +0,0 @@
-#
-# -------------------------------------------------------------------------
-#   Copyright (c) 2015-2017 AT&T Intellectual Property
-#
-#   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.
-#
-# -------------------------------------------------------------------------
-#
index 51efce1..e69de29 100644 (file)
@@ -1,18 +0,0 @@
-#
-# -------------------------------------------------------------------------
-#   Copyright (c) 2015-2017 AT&T Intellectual Property
-#
-#   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.
-#
-# -------------------------------------------------------------------------
-#
index f2bbdfd..e69de29 100644 (file)
@@ -1,19 +0,0 @@
-#
-# -------------------------------------------------------------------------
-#   Copyright (c) 2015-2017 AT&T Intellectual Property
-#
-#   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.
-#
-# -------------------------------------------------------------------------
-#
-
index 51efce1..e69de29 100755 (executable)
@@ -1,18 +0,0 @@
-#
-# -------------------------------------------------------------------------
-#   Copyright (c) 2015-2017 AT&T Intellectual Property
-#
-#   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.
-#
-# -------------------------------------------------------------------------
-#
index f2bbdfd..e69de29 100755 (executable)
@@ -1,19 +0,0 @@
-#
-# -------------------------------------------------------------------------
-#   Copyright (c) 2015-2017 AT&T Intellectual Property
-#
-#   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.
-#
-# -------------------------------------------------------------------------
-#
-
index 51efce1..e69de29 100755 (executable)
@@ -1,18 +0,0 @@
-#
-# -------------------------------------------------------------------------
-#   Copyright (c) 2015-2017 AT&T Intellectual Property
-#
-#   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.
-#
-# -------------------------------------------------------------------------
-#
index 51efce1..e69de29 100755 (executable)
@@ -1,18 +0,0 @@
-#
-# -------------------------------------------------------------------------
-#   Copyright (c) 2015-2017 AT&T Intellectual Property
-#
-#   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.
-#
-# -------------------------------------------------------------------------
-#
index 8cf3f86..66413be 100755 (executable)
@@ -18,8 +18,6 @@
 # -------------------------------------------------------------------------
 #
 
-
-
 from conductor.solver.utils import utils
 
 
index 5c422f1..0c9ffde 100755 (executable)
 
 # import json
 import operator
+
 from oslo_log import log
-import random
-# import sys
 
 from conductor.solver.optimizer.constraints \
     import access_distance as access_dist
-from conductor.solver.optimizer.constraints \
-    import cloud_distance as cloud_dist
 from conductor.solver.optimizer.constraints \
     import attribute as attribute_constraint
+from conductor.solver.optimizer.constraints \
+    import cloud_distance as cloud_dist
 # from conductor.solver.optimizer.constraints import constraint
 from conductor.solver.optimizer.constraints \
     import inventory_group
@@ -42,6 +41,8 @@ from conductor.solver.request.functions import cloud_version
 from conductor.solver.request.functions import distance_between
 from conductor.solver.request import objective
 
+# import sys
+
 # from conductor.solver.request.functions import distance_between
 # from conductor.solver.request import objective
 # from conductor.solver.resource import region
index 51efce1..e69de29 100755 (executable)
@@ -1,18 +0,0 @@
-#
-# -------------------------------------------------------------------------
-#   Copyright (c) 2015-2017 AT&T Intellectual Property
-#
-#   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.
-#
-# -------------------------------------------------------------------------
-#
index d0144da..46d2e28 100644 (file)
@@ -267,7 +267,8 @@ class SolverService(cotyledon.Service):
                             "sriov_automation":
                                 resource.get("sriov_automation"),
                             "cloud_owner": resource.get("cloud_owner"),
-                            'cloud_version': resource.get("cloud_region_version")},
+                            'cloud_version':
+                                resource.get("cloud_region_version")},
                     }
                     if rec["candidate"]["inventory_type"] == "service":
                         rec["attributes"]["host_id"] = resource.get("host_id")
index 51efce1..e69de29 100644 (file)
@@ -1,18 +0,0 @@
-#
-# -------------------------------------------------------------------------
-#   Copyright (c) 2015-2017 AT&T Intellectual Property
-#
-#   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.
-#
-# -------------------------------------------------------------------------
-#
index 51efce1..e69de29 100755 (executable)
@@ -1,18 +0,0 @@
-#
-# -------------------------------------------------------------------------
-#   Copyright (c) 2015-2017 AT&T Intellectual Property
-#
-#   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.
-#
-# -------------------------------------------------------------------------
-#
index 51efce1..e69de29 100755 (executable)
@@ -1,18 +0,0 @@
-#
-# -------------------------------------------------------------------------
-#   Copyright (c) 2015-2017 AT&T Intellectual Property
-#
-#   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.
-#
-# -------------------------------------------------------------------------
-#
index 51efce1..e69de29 100755 (executable)
@@ -1,18 +0,0 @@
-#
-# -------------------------------------------------------------------------
-#   Copyright (c) 2015-2017 AT&T Intellectual Property
-#
-#   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.
-#
-# -------------------------------------------------------------------------
-#
index f2bbdfd..e69de29 100644 (file)
@@ -1,19 +0,0 @@
-#
-# -------------------------------------------------------------------------
-#   Copyright (c) 2015-2017 AT&T Intellectual Property
-#
-#   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.
-#
-# -------------------------------------------------------------------------
-#
-
index 51efce1..e69de29 100644 (file)
@@ -1,18 +0,0 @@
-#
-# -------------------------------------------------------------------------
-#   Copyright (c) 2015-2017 AT&T Intellectual Property
-#
-#   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.
-#
-# -------------------------------------------------------------------------
-#
index 51efce1..e69de29 100644 (file)
@@ -1,18 +0,0 @@
-#
-# -------------------------------------------------------------------------
-#   Copyright (c) 2015-2017 AT&T Intellectual Property
-#
-#   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.
-#
-# -------------------------------------------------------------------------
-#
diff --git a/conductor/conductor/tests/tempest/__init__.py b/conductor/conductor/tests/tempest/__init__.py
deleted file mode 100644 (file)
index 51efce1..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# -------------------------------------------------------------------------
-#   Copyright (c) 2015-2017 AT&T Intellectual Property
-#
-#   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.
-#
-# -------------------------------------------------------------------------
-#
index 51efce1..e69de29 100644 (file)
@@ -1,18 +0,0 @@
-#
-# -------------------------------------------------------------------------
-#   Copyright (c) 2015-2017 AT&T Intellectual Property
-#
-#   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.
-#
-# -------------------------------------------------------------------------
-#
diff --git a/conductor/conductor/tests/unit/test_aai.py b/conductor/conductor/tests/unit/test_aai.py
new file mode 100644 (file)
index 0000000..65d348d
--- /dev/null
@@ -0,0 +1,44 @@
+from __future__ import absolute_import
+
+import json
+import unittest
+
+from conductor.solver.optimizer.constraints.access_distance import AccessDistance
+from conductor.solver.request.parser import Parser
+
+
+class TestConstaintAccessDistance(unittest.TestCase, AccessDistance):
+
+    def setUp(self):
+
+        self.parser = Parser()
+        self.parserExpected = {
+                               "demands": {},
+                               "locations": {},
+                               "cei": "null",
+                               "region_gen": "null",
+                               "request_id": "null",
+                               "objective": "null",
+                               "constraints": {}
+                              }
+        self.test_parser_template = self.parser.parse_template()
+
+    def test_correct_parser_attributes(self):
+      a = []
+      b = []
+
+      for k in sorted(self.parserExpected):
+        a.append(k)
+
+      for key, values in sorted(vars(self.parser).items()):
+        b.append(key)
+      a.sort()
+      b.sort()
+
+      self.assertEquals(a, b)
+
+    def tearDown(self):
+        pass
+
+if __name__ == '__main__':
+    unittest.main()
\ No newline at end of file
diff --git a/conductor/conductor/tests/unit/test_sample.py b/conductor/conductor/tests/unit/test_sample.py
new file mode 100644 (file)
index 0000000..2e05fbb
--- /dev/null
@@ -0,0 +1,8 @@
+import unittest
+
+def fun(x):
+    return x + 1
+
+class SimpleIntegralIncrementTest(unittest.TestCase):
+    def test(self):
+        self.assertEqual(fun(3), 4)
\ No newline at end of file
index 35bea94..498770f 100644 (file)
@@ -1,9 +1,8 @@
 [tox]
 minversion = 1.6
 skipsdist = True
-# envlist = py35,py27,functional,pep8
+#envlist = py35,py27,functional,pep8
 envlist = py27,pep8
-
 [testenv]
 deps = -r{toxinidir}/requirements.txt
        -r{toxinidir}/test-requirements.txt
@@ -45,7 +44,7 @@ setenv = PYTHONHASHSEED=0
 commands = bash -x oslo_debug_helper {posargs}
 
 [flake8]
-ignore = H301,E401
+ignore = H301,E401,E226,E302,E41,E303,E501,E265,E125,E101,E131,E127,E306,
 exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build,install-guide
 show-source = True