diff options
author | Andrei Zeliankou <zelenkov@nginx.com> | 2020-12-06 16:01:59 +0000 |
---|---|---|
committer | Andrei Zeliankou <zelenkov@nginx.com> | 2020-12-06 16:01:59 +0000 |
commit | 07789a23e9c513dba87b020fae2989a57955e8a6 (patch) | |
tree | aa5b77497ee957b79a67f70df796c0da49447a22 /test/unit | |
parent | 55296e6ff2613a0b2ec588beaf01620b2679c3d1 (diff) | |
download | unit-07789a23e9c513dba87b020fae2989a57955e8a6.tar.gz unit-07789a23e9c513dba87b020fae2989a57955e8a6.tar.bz2 |
Tests: options moved to the separate class.
This change is necessary to separate the logic
and prevent possible circular dependency.
Diffstat (limited to '')
-rw-r--r-- | test/unit/applications/lang/go.py | 2 | ||||
-rw-r--r-- | test/unit/applications/lang/java.py | 2 | ||||
-rw-r--r-- | test/unit/applications/lang/node.py | 2 | ||||
-rw-r--r-- | test/unit/applications/lang/perl.py | 2 | ||||
-rw-r--r-- | test/unit/applications/lang/php.py | 2 | ||||
-rw-r--r-- | test/unit/applications/lang/python.py | 2 | ||||
-rw-r--r-- | test/unit/applications/lang/ruby.py | 2 | ||||
-rw-r--r-- | test/unit/applications/proto.py | 2 | ||||
-rw-r--r-- | test/unit/applications/tls.py | 2 | ||||
-rw-r--r-- | test/unit/control.py | 2 | ||||
-rw-r--r-- | test/unit/feature/isolation.py | 2 | ||||
-rw-r--r-- | test/unit/http.py | 2 | ||||
-rw-r--r-- | test/unit/main.py | 2 | ||||
-rw-r--r-- | test/unit/option.py | 16 |
14 files changed, 29 insertions, 13 deletions
diff --git a/test/unit/applications/lang/go.py b/test/unit/applications/lang/go.py index 866dec47..70f9d58c 100644 --- a/test/unit/applications/lang/go.py +++ b/test/unit/applications/lang/go.py @@ -1,8 +1,8 @@ import os import subprocess -from conftest import option from unit.applications.proto import TestApplicationProto +from unit.option import option class TestApplicationGo(TestApplicationProto): diff --git a/test/unit/applications/lang/java.py b/test/unit/applications/lang/java.py index 0ff85187..b2e17f23 100644 --- a/test/unit/applications/lang/java.py +++ b/test/unit/applications/lang/java.py @@ -4,8 +4,8 @@ import shutil import subprocess import pytest -from conftest import option from unit.applications.proto import TestApplicationProto +from unit.option import option class TestApplicationJava(TestApplicationProto): diff --git a/test/unit/applications/lang/node.py b/test/unit/applications/lang/node.py index 98fd9ffc..baccef7e 100644 --- a/test/unit/applications/lang/node.py +++ b/test/unit/applications/lang/node.py @@ -1,9 +1,9 @@ import shutil from urllib.parse import quote -from conftest import option from conftest import public_dir from unit.applications.proto import TestApplicationProto +from unit.option import option class TestApplicationNode(TestApplicationProto): diff --git a/test/unit/applications/lang/perl.py b/test/unit/applications/lang/perl.py index 9dc24ace..58b867f0 100644 --- a/test/unit/applications/lang/perl.py +++ b/test/unit/applications/lang/perl.py @@ -1,5 +1,5 @@ -from conftest import option from unit.applications.proto import TestApplicationProto +from unit.option import option class TestApplicationPerl(TestApplicationProto): diff --git a/test/unit/applications/lang/php.py b/test/unit/applications/lang/php.py index 3dbb32f5..90c0078c 100644 --- a/test/unit/applications/lang/php.py +++ b/test/unit/applications/lang/php.py @@ -1,8 +1,8 @@ -from conftest import option import os import shutil from unit.applications.proto import TestApplicationProto +from unit.option import option class TestApplicationPHP(TestApplicationProto): diff --git a/test/unit/applications/lang/python.py b/test/unit/applications/lang/python.py index 792a86fa..287d23f0 100644 --- a/test/unit/applications/lang/python.py +++ b/test/unit/applications/lang/python.py @@ -3,8 +3,8 @@ import shutil from urllib.parse import quote import pytest -from conftest import option from unit.applications.proto import TestApplicationProto +from unit.option import option class TestApplicationPython(TestApplicationProto): diff --git a/test/unit/applications/lang/ruby.py b/test/unit/applications/lang/ruby.py index 82d66e65..02644584 100644 --- a/test/unit/applications/lang/ruby.py +++ b/test/unit/applications/lang/ruby.py @@ -1,5 +1,5 @@ -from conftest import option from unit.applications.proto import TestApplicationProto +from unit.option import option class TestApplicationRuby(TestApplicationProto): diff --git a/test/unit/applications/proto.py b/test/unit/applications/proto.py index 6e760c70..af05d071 100644 --- a/test/unit/applications/proto.py +++ b/test/unit/applications/proto.py @@ -2,8 +2,8 @@ import os import re import time -from conftest import option from unit.control import TestControl +from unit.option import option class TestApplicationProto(TestControl): diff --git a/test/unit/applications/tls.py b/test/unit/applications/tls.py index fb1b112c..b0cd5abb 100644 --- a/test/unit/applications/tls.py +++ b/test/unit/applications/tls.py @@ -2,8 +2,8 @@ import os import ssl import subprocess -from conftest import option from unit.applications.proto import TestApplicationProto +from unit.option import option class TestApplicationTLS(TestApplicationProto): diff --git a/test/unit/control.py b/test/unit/control.py index f05aa827..3008a64b 100644 --- a/test/unit/control.py +++ b/test/unit/control.py @@ -1,7 +1,7 @@ import json -from conftest import option from unit.http import TestHTTP +from unit.option import option def args_handler(conf_func): diff --git a/test/unit/feature/isolation.py b/test/unit/feature/isolation.py index 7877c03a..d8f68919 100644 --- a/test/unit/feature/isolation.py +++ b/test/unit/feature/isolation.py @@ -4,7 +4,7 @@ from unit.applications.lang.go import TestApplicationGo from unit.applications.lang.java import TestApplicationJava from unit.applications.lang.node import TestApplicationNode from unit.applications.proto import TestApplicationProto -from conftest import option +from unit.option import option class TestFeatureIsolation(TestApplicationProto): diff --git a/test/unit/http.py b/test/unit/http.py index 8d964978..ae74eac3 100644 --- a/test/unit/http.py +++ b/test/unit/http.py @@ -7,8 +7,8 @@ import select import socket import pytest -from conftest import option from unit.main import TestUnit +from unit.option import option class TestHTTP(TestUnit): diff --git a/test/unit/main.py b/test/unit/main.py index 488b3f4d..fce6a322 100644 --- a/test/unit/main.py +++ b/test/unit/main.py @@ -1,5 +1,5 @@ import pytest -from conftest import option +from unit.option import option class TestUnit(): diff --git a/test/unit/option.py b/test/unit/option.py new file mode 100644 index 00000000..677d806e --- /dev/null +++ b/test/unit/option.py @@ -0,0 +1,16 @@ +class Options(): + _options = { + 'skip_alerts': [], + 'skip_sanitizer': False, + } + + def __setattr__(self, name, value): + Options._options[name] = value + + def __getattr__(self, name): + if name in Options._options: + return Options._options[name] + + raise AttributeError + +option = Options() |