Skip to content
Snippets Groups Projects
Commit 8a0a6b31 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Pre-merge code cleanup

parent 06006a76
No related branches found
No related tags found
2 merge requests!294Release TeraFlowSDN 4.0,!262Resolve "(OPT) SBI for QKD Nodes", "(OPT) QKD Network Topology" and "(OPT) Path Computation for QKD Networks"
Showing
with 23 additions and 2873 deletions
...@@ -166,4 +166,3 @@ class QKDDriver(_Driver): ...@@ -166,4 +166,3 @@ class QKDDriver(_Driver):
# TODO: QKD API Driver does not support monitoring by now # TODO: QKD API Driver does not support monitoring by now
LOGGER.info(f'GetState {self.address} called') LOGGER.info(f'GetState {self.address} called')
return [] return []
...@@ -24,4 +24,4 @@ RESOURCE_KEY_MAPPINGS = { ...@@ -24,4 +24,4 @@ RESOURCE_KEY_MAPPINGS = {
RESOURCE_APPS : 'apps', RESOURCE_APPS : 'apps',
RESOURCE_CAPABILITES : 'capabilities', RESOURCE_CAPABILITES : 'capabilities',
RESOURCE_NODE : 'node' RESOURCE_NODE : 'node'
} }
\ No newline at end of file
...@@ -16,8 +16,8 @@ import pytest ...@@ -16,8 +16,8 @@ import pytest
import requests import requests
import json import json
import os import os
from src.device.service.drivers.qkd.QKDDriver2 import QKDDriver from device.service.drivers.qkd.QKDDriver2 import QKDDriver
from src.device.service.drivers.qkd.Tools2 import ( from device.service.drivers.qkd.Tools2 import (
RESOURCE_INTERFACES, RESOURCE_INTERFACES,
RESOURCE_LINKS, RESOURCE_LINKS,
RESOURCE_CAPABILITES, RESOURCE_CAPABILITES,
......
This diff is collapsed.
This diff is collapsed.
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import pytest import pytest
import json import json
from src.device.service.drivers.qkd.QKDDriver2 import QKDDriver from device.service.drivers.qkd.QKDDriver2 import QKDDriver
MOCK_QKD_ADDRRESS = '127.0.0.1' MOCK_QKD_ADDRRESS = '127.0.0.1'
MOCK_PORT = 11111 MOCK_PORT = 11111
......
...@@ -15,9 +15,9 @@ ...@@ -15,9 +15,9 @@
import pytest import pytest
import json import json
from requests.exceptions import HTTPError from requests.exceptions import HTTPError
from src.device.service.drivers.qkd.QKDDriver2 import QKDDriver from device.service.drivers.qkd.QKDDriver2 import QKDDriver
import requests import requests
from src.device.service.drivers.qkd.Tools2 import ( from device.service.drivers.qkd.Tools2 import (
RESOURCE_INTERFACES, RESOURCE_INTERFACES,
RESOURCE_LINKS, RESOURCE_LINKS,
RESOURCE_ENDPOINTS, RESOURCE_ENDPOINTS,
......
...@@ -12,11 +12,9 @@ ...@@ -12,11 +12,9 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import pytest import pytest, requests
from requests.exceptions import HTTPError from requests.exceptions import ConnectionError, HTTPError, Timeout
from src.device.service.drivers.qkd.QKDDriver2 import QKDDriver from device.service.drivers.qkd.QKDDriver2 import QKDDriver
from requests.exceptions import ConnectionError, Timeout
import requests
MOCK_QKD_ADDRRESS = '127.0.0.1' MOCK_QKD_ADDRRESS = '127.0.0.1'
MOCK_PORT = 11111 MOCK_PORT = 11111
......
...@@ -12,10 +12,9 @@ ...@@ -12,10 +12,9 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import pytest import pytest, requests
from unittest.mock import patch from unittest.mock import patch
from src.device.service.drivers.qkd.QKDDriver import QKDDriver from device.service.drivers.qkd.QKDDriver import QKDDriver
import requests
MOCK_QKD_ADDRRESS = '127.0.0.1' MOCK_QKD_ADDRRESS = '127.0.0.1'
MOCK_PORT = 11111 MOCK_PORT = 11111
...@@ -34,7 +33,7 @@ def test_qkd_driver_invalid_connection(): ...@@ -34,7 +33,7 @@ def test_qkd_driver_invalid_connection():
assert qkd_driver.Connect() is False assert qkd_driver.Connect() is False
# Deliverable Test ID: SBI_Test_10 # Deliverable Test ID: SBI_Test_10
@patch('src.device.service.drivers.qkd.QKDDriver2.requests.get') @patch('device.service.drivers.qkd.QKDDriver2.requests.get')
def test_qkd_driver_timeout_connection(mock_get, qkd_driver): def test_qkd_driver_timeout_connection(mock_get, qkd_driver):
mock_get.side_effect = requests.exceptions.Timeout mock_get.side_effect = requests.exceptions.Timeout
qkd_driver.timeout = 0.001 # Simulate very short timeout qkd_driver.timeout = 0.001 # Simulate very short timeout
......
...@@ -14,9 +14,8 @@ ...@@ -14,9 +14,8 @@
# tests/unit/test_qkd_performance.py # tests/unit/test_qkd_performance.py
import pytest import pytest, time
import time from device.service.drivers.qkd.QKDDriver2 import QKDDriver
from src.device.service.drivers.qkd.QKDDriver2 import QKDDriver
MOCK_QKD_ADDRRESS = '127.0.0.1' MOCK_QKD_ADDRRESS = '127.0.0.1'
MOCK_PORT = 11111 MOCK_PORT = 11111
......
...@@ -12,13 +12,13 @@ ...@@ -12,13 +12,13 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import pytest
import json import json
import os import os
from requests.exceptions import HTTPError import pytest
from src.device.service.drivers.qkd.QKDDriver2 import QKDDriver
from src.device.service.drivers.qkd.Tools2 import RESOURCE_CAPABILITES
import requests import requests
from requests.exceptions import HTTPError
from device.service.drivers.qkd.QKDDriver2 import QKDDriver
from device.service.drivers.qkd.Tools2 import RESOURCE_CAPABILITES
# Helper function to print data in a formatted JSON style for debugging # Helper function to print data in a formatted JSON style for debugging
def print_data(label, data): def print_data(label, data):
......
...@@ -13,8 +13,8 @@ ...@@ -13,8 +13,8 @@
# limitations under the License. # limitations under the License.
import pytest import pytest
from src.device.service.drivers.qkd.QKDDriver2 import QKDDriver
from typing import List, Tuple from typing import List, Tuple
from device.service.drivers.qkd.QKDDriver2 import QKDDriver
MOCK_QKD_ADDRRESS = '127.0.0.1' MOCK_QKD_ADDRRESS = '127.0.0.1'
MOCK_PORT = 11111 MOCK_PORT = 11111
......
...@@ -13,8 +13,8 @@ ...@@ -13,8 +13,8 @@
# limitations under the License. # limitations under the License.
import pytest import pytest
from src.device.service.drivers.qkd.QKDDriver2 import QKDDriver
from typing import List, Tuple from typing import List, Tuple
from device.service.drivers.qkd.QKDDriver2 import QKDDriver
MOCK_QKD_ADDRRESS = '127.0.0.1' MOCK_QKD_ADDRRESS = '127.0.0.1'
MOCK_PORT = 11111 MOCK_PORT = 11111
......
...@@ -12,12 +12,10 @@ ...@@ -12,12 +12,10 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import pytest import pytest, requests, uuid
import requests
from requests.exceptions import HTTPError from requests.exceptions import HTTPError
from src.device.service.drivers.qkd.QKDDriver2 import QKDDriver from device.service.drivers.qkd.QKDDriver2 import QKDDriver
from src.device.service.drivers.qkd.Tools2 import RESOURCE_APPS from device.service.drivers.qkd.Tools2 import RESOURCE_APPS
import uuid
MOCK_QKD1_ADDRRESS = '127.0.0.1' MOCK_QKD1_ADDRRESS = '127.0.0.1'
MOCK_PORT1 = 11111 MOCK_PORT1 = 11111
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment