plugin NAT port: disable the plugin for tests:
The UPnP-IGD devices discovery takes time and is not necessary during tests, so this plugin is now diable during tests.
This commit is contained in:
parent
e68278a1ac
commit
b0a94124d2
1 changed files with 7 additions and 1 deletions
|
|
@ -17,6 +17,7 @@
|
|||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import sys
|
||||
from libervia.backend.core.i18n import _
|
||||
from libervia.backend.core.constants import Const as C
|
||||
from libervia.backend.core.log import getLogger
|
||||
|
|
@ -28,6 +29,11 @@ from twisted.internet import defer
|
|||
from twisted.python import failure
|
||||
import threading
|
||||
|
||||
|
||||
if "pytest" in sys.modules:
|
||||
# We skip this module during tests to avoid waiting for UPnP-IGD.
|
||||
raise exceptions.CancelError("This module is not run during tests.")
|
||||
|
||||
try:
|
||||
import miniupnpc
|
||||
except ImportError:
|
||||
|
|
@ -46,7 +52,7 @@ PLUGIN_INFO = {
|
|||
}
|
||||
|
||||
STARTING_PORT = 6000 # starting point to automatically find a port
|
||||
DEFAULT_DESC = "SaT port mapping" # we don't use "à" here as some bugged NAT don't manage charset correctly
|
||||
DEFAULT_DESC = "Libervia port mapping"
|
||||
|
||||
|
||||
class MappingError(Exception):
|
||||
|
|
|
|||
Loading…
Reference in a new issue