wwpdb.utils.testing 0.18__tar.gz → 0.19__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {wwpdb_utils_testing-0.18/wwpdb.utils.testing.egg-info → wwpdb_utils_testing-0.19}/PKG-INFO +2 -2
- {wwpdb_utils_testing-0.18 → wwpdb_utils_testing-0.19}/pyproject.toml +5 -2
- {wwpdb_utils_testing-0.18 → wwpdb_utils_testing-0.19}/tox.ini +21 -4
- {wwpdb_utils_testing-0.18 → wwpdb_utils_testing-0.19}/wwpdb/utils/testing/CreateRWTree.py +39 -9
- {wwpdb_utils_testing-0.18 → wwpdb_utils_testing-0.19}/wwpdb/utils/testing/Features.py +9 -9
- {wwpdb_utils_testing-0.18 → wwpdb_utils_testing-0.19}/wwpdb/utils/testing/SiteConfigSetup.py +2 -2
- {wwpdb_utils_testing-0.18 → wwpdb_utils_testing-0.19}/wwpdb/utils/testing/__init__.py +1 -1
- {wwpdb_utils_testing-0.18 → wwpdb_utils_testing-0.19/wwpdb.utils.testing.egg-info}/PKG-INFO +2 -2
- {wwpdb_utils_testing-0.18 → wwpdb_utils_testing-0.19}/wwpdb.utils.testing.egg-info/SOURCES.txt +1 -4
- wwpdb_utils_testing-0.18/wwpdb/utils/tests-testing/CreateRWTreeTest.py +0 -84
- wwpdb_utils_testing-0.18/wwpdb/utils/tests-testing/FeaturesTest.py +0 -77
- wwpdb_utils_testing-0.18/wwpdb/utils/tests-testing/__init__.py +0 -0
- {wwpdb_utils_testing-0.18 → wwpdb_utils_testing-0.19}/LICENSE +0 -0
- {wwpdb_utils_testing-0.18 → wwpdb_utils_testing-0.19}/MANIFEST.in +0 -0
- {wwpdb_utils_testing-0.18 → wwpdb_utils_testing-0.19}/README.md +0 -0
- {wwpdb_utils_testing-0.18 → wwpdb_utils_testing-0.19}/requirements.txt +0 -0
- {wwpdb_utils_testing-0.18 → wwpdb_utils_testing-0.19}/setup.cfg +0 -0
- {wwpdb_utils_testing-0.18 → wwpdb_utils_testing-0.19}/wwpdb/mock-data/README.md +0 -0
- {wwpdb_utils_testing-0.18 → wwpdb_utils_testing-0.19}/wwpdb/mock-data/da_top/data/archive/D_000001/D_000001_model_P1.cif.V3 +0 -0
- {wwpdb_utils_testing-0.18 → wwpdb_utils_testing-0.19}/wwpdb/mock-data/da_top/resources_ro/actionData.xml +0 -0
- {wwpdb_utils_testing-0.18 → wwpdb_utils_testing-0.19}/wwpdb/mock-data/da_top/resources_ro/content_ws/ws_content_type_definitions.json +0 -0
- {wwpdb_utils_testing-0.18 → wwpdb_utils_testing-0.19}/wwpdb/mock-data/da_top/resources_ro/depui/site_access_info.json +0 -0
- {wwpdb_utils_testing-0.18 → wwpdb_utils_testing-0.19}/wwpdb/mock-data/da_top/resources_ro/emd/emdb_fsc.xsd +0 -0
- {wwpdb_utils_testing-0.18 → wwpdb_utils_testing-0.19}/wwpdb/mock-data/da_top/webapps/htdocs/msgmodule/msg_tmplts.html +0 -0
- {wwpdb_utils_testing-0.18 → wwpdb_utils_testing-0.19}/wwpdb/mock-data/da_top/webapps/htdocs/msgmodule/msging_launch_tmplt.html +0 -0
- {wwpdb_utils_testing-0.18 → wwpdb_utils_testing-0.19}/wwpdb/mock-data/da_top/webapps/version.json +0 -0
- {wwpdb_utils_testing-0.18 → wwpdb_utils_testing-0.19}/wwpdb/mock-data/site-config/common/common.cfg +0 -0
- {wwpdb_utils_testing-0.18 → wwpdb_utils_testing-0.19}/wwpdb/mock-data/site-config/rcsb-east/site_common/common.cfg +0 -0
- {wwpdb_utils_testing-0.18 → wwpdb_utils_testing-0.19}/wwpdb/mock-data/site-config/rcsb-east/wwpdb_deploy_test/site.cfg +0 -0
- {wwpdb_utils_testing-0.18 → wwpdb_utils_testing-0.19}/wwpdb.utils.testing.egg-info/dependency_links.txt +0 -0
- {wwpdb_utils_testing-0.18 → wwpdb_utils_testing-0.19}/wwpdb.utils.testing.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: wwpdb.utils.testing
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.19
|
|
4
4
|
Summary: wwPDB Python DB Schema Utilities
|
|
5
5
|
Author-email: Ezra Peisach <ezra.peisach@rcsb.org>
|
|
6
6
|
License: Apache 2.0
|
|
@@ -9,10 +9,10 @@ Classifier: Intended Audience :: Developers
|
|
|
9
9
|
Classifier: Natural Language :: English
|
|
10
10
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
11
11
|
Classifier: Programming Language :: Python
|
|
12
|
-
Classifier: Programming Language :: Python :: 2.7
|
|
13
12
|
Classifier: Programming Language :: Python :: 3
|
|
14
13
|
Classifier: Programming Language :: Python :: 3.6
|
|
15
14
|
Classifier: Programming Language :: Python :: 3.7
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
16
16
|
Requires-Python: >=3.6
|
|
17
17
|
Description-Content-Type: text/markdown
|
|
18
18
|
License-File: LICENSE
|
|
@@ -16,10 +16,10 @@ classifiers = [
|
|
|
16
16
|
"Natural Language :: English",
|
|
17
17
|
"License :: OSI Approved :: Apache Software License",
|
|
18
18
|
"Programming Language :: Python",
|
|
19
|
-
"Programming Language :: Python :: 2.7",
|
|
20
19
|
"Programming Language :: Python :: 3",
|
|
21
20
|
"Programming Language :: Python :: 3.6",
|
|
22
21
|
"Programming Language :: Python :: 3.7",
|
|
22
|
+
"Programming Language :: Python :: 3.8",
|
|
23
23
|
]
|
|
24
24
|
dependencies = []
|
|
25
25
|
dynamic = ["version"]
|
|
@@ -29,7 +29,7 @@ dynamic = ["version"]
|
|
|
29
29
|
|
|
30
30
|
[tool.setuptools.packages.find]
|
|
31
31
|
where = ["."]
|
|
32
|
-
exclude = ["wwpdb.utils.
|
|
32
|
+
exclude = ["wwpdb.utils.tests_*"]
|
|
33
33
|
namespaces = true
|
|
34
34
|
|
|
35
35
|
[tool.setuptools.dynamic]
|
|
@@ -40,5 +40,8 @@ version = {attr = "wwpdb.utils.testing.__version__"}
|
|
|
40
40
|
# MANIFEST.in files in wheel - but keep in sdist
|
|
41
41
|
include-package-data = false
|
|
42
42
|
|
|
43
|
+
[tool.setuptools.package-data]
|
|
44
|
+
mypkg = ["*.pyi", "*.rst", "py.typed"]
|
|
45
|
+
|
|
43
46
|
[tool.distutils.bdist_wheel]
|
|
44
47
|
universal = true
|
|
@@ -7,20 +7,22 @@
|
|
|
7
7
|
test_pattern = "*Test.py"
|
|
8
8
|
#
|
|
9
9
|
# Source pathls (unquoted and space separated list of files/directories) for linting and format checks
|
|
10
|
-
source_paths = wwpdb/utils/testing wwpdb/utils/
|
|
10
|
+
source_paths = wwpdb/utils/testing wwpdb/utils/tests_testing
|
|
11
11
|
#
|
|
12
12
|
# Start directory path for test discovery
|
|
13
13
|
# Each path must reference valid directory that is searchable by python3.9 (i.e. contains __init__.py)
|
|
14
14
|
# ** It is harmless to point to paths containing no tests.
|
|
15
15
|
#
|
|
16
|
-
test_path_1 = "wwpdb/utils/
|
|
16
|
+
test_path_1 = "wwpdb/utils/tests_testing"
|
|
17
17
|
# These are placeholders valid source directories without tests files
|
|
18
18
|
test_path_2 = "wwpdb/utils/testing"
|
|
19
19
|
test_path_3 = "wwpdb/utils/testing"
|
|
20
20
|
test_path_4 = "wwpdb/utils/testing"
|
|
21
21
|
#
|
|
22
|
+
mypy_path = "wwpdb"
|
|
23
|
+
#
|
|
22
24
|
# Comma separate list of directories/patterns for which test coverage will be evaluated
|
|
23
|
-
coverage_source_paths = "wwpdb/utils/testing,wwpdb/utils/
|
|
25
|
+
coverage_source_paths = "wwpdb/utils/testing,wwpdb/utils/tests_testing"
|
|
24
26
|
# SiteConfig can only be tested when wwpdb.utils.config available
|
|
25
27
|
coverage_exclude_paths = "wwpdb/__init__.py,wwpdb/utils/testing/SiteConfigSetup.py"
|
|
26
28
|
coverage_cutoff = 65
|
|
@@ -35,7 +37,7 @@ coverage_cutoff = 65
|
|
|
35
37
|
##
|
|
36
38
|
[tox]
|
|
37
39
|
# The complete list of supported test environments to setup and invoke
|
|
38
|
-
envlist = format_pep8-{py39}, lint_pylint-{py39}, format_black-{py39}, {py39}, test_coverage-{py39}
|
|
40
|
+
envlist = format_pep8-{py39}, lint_pylint-{py39}, format_black-{py39}, {py39}, test_coverage-{py39}, mypy-{py39}
|
|
39
41
|
#
|
|
40
42
|
minversion = 3.4.0
|
|
41
43
|
skip_missing_interpreters = true
|
|
@@ -104,6 +106,21 @@ commands =
|
|
|
104
106
|
echo "Completed {envname}"
|
|
105
107
|
|
|
106
108
|
#
|
|
109
|
+
[testenv:mypy-py3{8,9,10,11,12,13}]
|
|
110
|
+
description = 'Run typing compliance checks (mypy)'
|
|
111
|
+
platform=
|
|
112
|
+
macos: darwin
|
|
113
|
+
linux: linux
|
|
114
|
+
|
|
115
|
+
deps =
|
|
116
|
+
mypy
|
|
117
|
+
-r requirements.txt
|
|
118
|
+
commands =
|
|
119
|
+
echo "Starting {envname}"
|
|
120
|
+
mypy --strict -p {[local_settings]mypy_path}
|
|
121
|
+
echo "Completed {envname}"
|
|
122
|
+
|
|
123
|
+
|
|
107
124
|
[testenv:format_black-py3{9,10,11,12,13}]
|
|
108
125
|
description = 'Run format compliance checks (black)'
|
|
109
126
|
platform=
|
|
@@ -20,11 +20,13 @@ import logging
|
|
|
20
20
|
import shutil
|
|
21
21
|
import os
|
|
22
22
|
|
|
23
|
+
from typing import List, Any, Optional, Union
|
|
24
|
+
|
|
23
25
|
logger = logging.getLogger(__name__)
|
|
24
26
|
|
|
25
27
|
|
|
26
28
|
class CreateRWTree(object):
|
|
27
|
-
def __init__(self, source=None, destination=None):
|
|
29
|
+
def __init__(self, source: Optional[str] = None, destination: Optional[str] = None) -> None:
|
|
28
30
|
self.__srcDir = source
|
|
29
31
|
self.__dstDir = destination
|
|
30
32
|
self.__reqOpts = {
|
|
@@ -37,7 +39,10 @@ class CreateRWTree(object):
|
|
|
37
39
|
"webapps": "_copywebapps",
|
|
38
40
|
}
|
|
39
41
|
|
|
40
|
-
def createtree(self, objlist=None):
|
|
42
|
+
def createtree(self, objlist: Optional[List[Any]] = None) -> None:
|
|
43
|
+
if objlist is None:
|
|
44
|
+
logger.error("createtree with no objlist - Fatal")
|
|
45
|
+
return
|
|
41
46
|
for obj in objlist:
|
|
42
47
|
if type(obj) is str:
|
|
43
48
|
req = obj
|
|
@@ -51,6 +56,9 @@ class CreateRWTree(object):
|
|
|
51
56
|
|
|
52
57
|
if req in self.__reqOpts:
|
|
53
58
|
mth = getattr(self, self.__reqOpts[req], None)
|
|
59
|
+
if mth is None:
|
|
60
|
+
logger.error("Could not locate %s - fatal", self.__reqOpts[req])
|
|
61
|
+
return
|
|
54
62
|
if opt_arg:
|
|
55
63
|
mth(opt_arg)
|
|
56
64
|
else:
|
|
@@ -58,17 +66,23 @@ class CreateRWTree(object):
|
|
|
58
66
|
else:
|
|
59
67
|
logger.error("%s not known", req)
|
|
60
68
|
|
|
61
|
-
def _copysiteconfig(self):
|
|
69
|
+
def _copysiteconfig(self) -> None:
|
|
62
70
|
"""Copies the site config tree down so that MockTopDir will be the top of the r/w tree"""
|
|
63
71
|
logger.info("Creating %s", self.__dstDir)
|
|
72
|
+
if self.__srcDir is None or self.__dstDir is None:
|
|
73
|
+
logger.error("srcDir of dstDir not set --- FATAL")
|
|
74
|
+
return
|
|
64
75
|
src = os.path.join(self.__srcDir, "site-config")
|
|
65
76
|
dst = os.path.join(self.__dstDir, "site-config")
|
|
66
77
|
if os.path.exists(dst):
|
|
67
78
|
shutil.rmtree(dst)
|
|
68
79
|
shutil.copytree(src, dst)
|
|
69
80
|
|
|
70
|
-
def _copyactiondata(self):
|
|
81
|
+
def _copyactiondata(self) -> None:
|
|
71
82
|
"""Copies the actondata definitions"""
|
|
83
|
+
if self.__srcDir is None or self.__dstDir is None:
|
|
84
|
+
logger.error("srcDir of dstDir not set --- FATAL")
|
|
85
|
+
return
|
|
72
86
|
src = os.path.join(self.__srcDir, "da_top", "resources_ro", "actionData.xml")
|
|
73
87
|
dst = os.path.join(self.__dstDir, "da_top", "resources_ro", "actionData.xml")
|
|
74
88
|
logger.info("Copying %s to %s", src, dst)
|
|
@@ -79,39 +93,51 @@ class CreateRWTree(object):
|
|
|
79
93
|
os.makedirs(dst_base)
|
|
80
94
|
shutil.copyfile(src, dst)
|
|
81
95
|
|
|
82
|
-
def _copydepuiresources(self):
|
|
96
|
+
def _copydepuiresources(self) -> None:
|
|
83
97
|
"""Copies the depui resources tree so that MockTopDir will be the top of the r/w tree"""
|
|
84
98
|
logger.info("Creating %s", self.__dstDir)
|
|
99
|
+
if self.__srcDir is None or self.__dstDir is None:
|
|
100
|
+
logger.error("srcDir of dstDir not set --- FATAL")
|
|
101
|
+
return
|
|
85
102
|
src = os.path.join(self.__srcDir, "da_top", "resources_ro", "depui")
|
|
86
103
|
dst = os.path.join(self.__dstDir, "da_top", "resources_ro", "depui")
|
|
87
104
|
if os.path.exists(dst):
|
|
88
105
|
shutil.rmtree(dst)
|
|
89
106
|
shutil.copytree(src, dst)
|
|
90
107
|
|
|
91
|
-
def _copyemdresources(self):
|
|
108
|
+
def _copyemdresources(self) -> None:
|
|
92
109
|
"""Copies the emd resources tree so that MockTopDir will be the top of the r/w tree"""
|
|
93
110
|
logger.info("Creating %s", self.__dstDir)
|
|
111
|
+
if self.__srcDir is None or self.__dstDir is None:
|
|
112
|
+
logger.error("srcDir of dstDir not set --- FATAL")
|
|
113
|
+
return
|
|
94
114
|
src = os.path.join(self.__srcDir, "da_top", "resources_ro", "emd")
|
|
95
115
|
dst = os.path.join(self.__dstDir, "da_top", "resources_ro", "emd")
|
|
96
116
|
if os.path.exists(dst):
|
|
97
117
|
shutil.rmtree(dst)
|
|
98
118
|
shutil.copytree(src, dst)
|
|
99
119
|
|
|
100
|
-
def _copywsresources(self):
|
|
120
|
+
def _copywsresources(self) -> None:
|
|
101
121
|
"""Copies the content_ws resources tree so that MockTopDir will be the top of the r/w tree"""
|
|
102
122
|
logger.info("Creating %s", self.__dstDir)
|
|
123
|
+
if self.__srcDir is None or self.__dstDir is None:
|
|
124
|
+
logger.error("srcDir of dstDir not set --- FATAL")
|
|
125
|
+
return
|
|
103
126
|
src = os.path.join(self.__srcDir, "da_top", "resources_ro", "content_ws")
|
|
104
127
|
dst = os.path.join(self.__dstDir, "da_top", "resources_ro", "content_ws")
|
|
105
128
|
if os.path.exists(dst):
|
|
106
129
|
shutil.rmtree(dst)
|
|
107
130
|
shutil.copytree(src, dst)
|
|
108
131
|
|
|
109
|
-
def _copywebapps(self, modules=None):
|
|
132
|
+
def _copywebapps(self, modules: Optional[Union[str, List[Any]]] = None) -> None:
|
|
110
133
|
"""Copies selected webapps resources tree so that MockTopDir will be the top of the r/w tree"""
|
|
111
134
|
if type(modules) is str:
|
|
112
135
|
modules = [modules]
|
|
113
136
|
|
|
114
137
|
# Copy version number
|
|
138
|
+
if self.__srcDir is None or self.__dstDir is None:
|
|
139
|
+
logger.error("srcDir of dstDir not set --- FATAL")
|
|
140
|
+
return
|
|
115
141
|
websrcdir = os.path.join(self.__srcDir, "da_top", "webapps")
|
|
116
142
|
webdstdir = os.path.join(self.__dstDir, "da_top", "webapps")
|
|
117
143
|
src = os.path.join(websrcdir, "version.json")
|
|
@@ -136,8 +162,12 @@ class CreateRWTree(object):
|
|
|
136
162
|
shutil.rmtree(dst)
|
|
137
163
|
shutil.copytree(src, dst)
|
|
138
164
|
|
|
139
|
-
def _copyarchive(self, idlist):
|
|
165
|
+
def _copyarchive(self, idlist: Union[str, List[Any]]) -> None:
|
|
140
166
|
"""Copies the archive directory down so that MockTopDir will be the top of the r/w tree"""
|
|
167
|
+
if self.__srcDir is None or self.__dstDir is None:
|
|
168
|
+
logger.error("srcDir of dstDir not set --- FATAL")
|
|
169
|
+
return
|
|
170
|
+
|
|
141
171
|
if type(idlist) is str:
|
|
142
172
|
idlist = [idlist]
|
|
143
173
|
|
|
@@ -19,42 +19,42 @@ import os
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
class Features(object):
|
|
22
|
-
def haveApi(self):
|
|
22
|
+
def haveApi(self) -> bool:
|
|
23
23
|
"""Returns True is api services available"""
|
|
24
24
|
return True
|
|
25
25
|
|
|
26
|
-
def haveMySqlTestServer(self):
|
|
26
|
+
def haveMySqlTestServer(self) -> bool:
|
|
27
27
|
"""Returns True if MySql server available for testing"""
|
|
28
28
|
if os.getenv("MYSQLUP"):
|
|
29
29
|
return True
|
|
30
30
|
return False
|
|
31
31
|
|
|
32
|
-
def haveRbmqTestServer(self):
|
|
32
|
+
def haveRbmqTestServer(self) -> bool:
|
|
33
33
|
"""Returns True if MySql server available for testing"""
|
|
34
34
|
if os.getenv("RBMQUP"): # pragma: no cover
|
|
35
35
|
return True
|
|
36
36
|
return False
|
|
37
37
|
|
|
38
|
-
def haveCvsTestServer(self):
|
|
38
|
+
def haveCvsTestServer(self) -> bool:
|
|
39
39
|
"""Returns True if CVS server available for testing"""
|
|
40
40
|
return False
|
|
41
41
|
|
|
42
|
-
def haveSvnTestServer(self):
|
|
42
|
+
def haveSvnTestServer(self) -> bool:
|
|
43
43
|
"""Returns True if SVN server available for testing"""
|
|
44
44
|
return False
|
|
45
45
|
|
|
46
|
-
def haveSftpTestServer(self):
|
|
46
|
+
def haveSftpTestServer(self) -> bool:
|
|
47
47
|
"""Returns True if SFTP server available for testing"""
|
|
48
48
|
return False
|
|
49
49
|
|
|
50
|
-
def haveToolsRuntime(self):
|
|
50
|
+
def haveToolsRuntime(self) -> bool:
|
|
51
51
|
"""Returns True if runtime tools available in environment"""
|
|
52
52
|
return False
|
|
53
53
|
|
|
54
|
-
def haveCCD(self):
|
|
54
|
+
def haveCCD(self) -> bool:
|
|
55
55
|
"""Returns True if CCD available for use in read only tests"""
|
|
56
56
|
return False
|
|
57
57
|
|
|
58
|
-
def testNever(self):
|
|
58
|
+
def testNever(self) -> bool:
|
|
59
59
|
"""Always returns False to confirm ability to skip in testing"""
|
|
60
60
|
return False
|
{wwpdb_utils_testing-0.18 → wwpdb_utils_testing-0.19}/wwpdb/utils/testing/SiteConfigSetup.py
RENAMED
|
@@ -24,10 +24,10 @@ from subprocess import call
|
|
|
24
24
|
|
|
25
25
|
# Empty class for import
|
|
26
26
|
class SiteConfigSetup(object):
|
|
27
|
-
def __init__(self):
|
|
27
|
+
def __init__(self) -> None:
|
|
28
28
|
pass
|
|
29
29
|
|
|
30
|
-
def setupEnvironment(self, TestOutputPath, MockDirPath):
|
|
30
|
+
def setupEnvironment(self, TestOutputPath: str, MockDirPath: str) -> None:
|
|
31
31
|
if not os.path.exists(TestOutputPath):
|
|
32
32
|
os.makedirs(TestOutputPath)
|
|
33
33
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: wwpdb.utils.testing
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.19
|
|
4
4
|
Summary: wwPDB Python DB Schema Utilities
|
|
5
5
|
Author-email: Ezra Peisach <ezra.peisach@rcsb.org>
|
|
6
6
|
License: Apache 2.0
|
|
@@ -9,10 +9,10 @@ Classifier: Intended Audience :: Developers
|
|
|
9
9
|
Classifier: Natural Language :: English
|
|
10
10
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
11
11
|
Classifier: Programming Language :: Python
|
|
12
|
-
Classifier: Programming Language :: Python :: 2.7
|
|
13
12
|
Classifier: Programming Language :: Python :: 3
|
|
14
13
|
Classifier: Programming Language :: Python :: 3.6
|
|
15
14
|
Classifier: Programming Language :: Python :: 3.7
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
16
16
|
Requires-Python: >=3.6
|
|
17
17
|
Description-Content-Type: text/markdown
|
|
18
18
|
License-File: LICENSE
|
{wwpdb_utils_testing-0.18 → wwpdb_utils_testing-0.19}/wwpdb.utils.testing.egg-info/SOURCES.txt
RENAMED
|
@@ -23,7 +23,4 @@ wwpdb/mock-data/site-config/rcsb-east/wwpdb_deploy_test/site.cfg
|
|
|
23
23
|
wwpdb/utils/testing/CreateRWTree.py
|
|
24
24
|
wwpdb/utils/testing/Features.py
|
|
25
25
|
wwpdb/utils/testing/SiteConfigSetup.py
|
|
26
|
-
wwpdb/utils/testing/__init__.py
|
|
27
|
-
wwpdb/utils/tests-testing/CreateRWTreeTest.py
|
|
28
|
-
wwpdb/utils/tests-testing/FeaturesTest.py
|
|
29
|
-
wwpdb/utils/tests-testing/__init__.py
|
|
26
|
+
wwpdb/utils/testing/__init__.py
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
##
|
|
2
|
-
#
|
|
3
|
-
# File: CreateRWTreeTest.py
|
|
4
|
-
# Author: E. Peisach
|
|
5
|
-
# Date: 21-Dec-2019
|
|
6
|
-
# Version: 0.001
|
|
7
|
-
##
|
|
8
|
-
"""
|
|
9
|
-
Test cases for copying configurations
|
|
10
|
-
|
|
11
|
-
"""
|
|
12
|
-
__docformat__ = "restructuredtext en"
|
|
13
|
-
__author__ = "Ezra Peisach"
|
|
14
|
-
__email__ = "peisach@rcsb.rutgers.edu"
|
|
15
|
-
__license__ = "Creative Commons Attribution 3.0 Unported"
|
|
16
|
-
__version__ = "V0.01"
|
|
17
|
-
|
|
18
|
-
import os
|
|
19
|
-
import platform
|
|
20
|
-
import unittest
|
|
21
|
-
import shutil
|
|
22
|
-
from wwpdb.utils.testing.CreateRWTree import CreateRWTree
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
class CreateRWTreeTest(unittest.TestCase):
|
|
26
|
-
@classmethod
|
|
27
|
-
def setUpClass(cls):
|
|
28
|
-
cls.__here = os.path.abspath(os.path.dirname(__file__))
|
|
29
|
-
TESTOUTPUT = os.path.join(cls.__here, "test-output", platform.python_version(), "copytest")
|
|
30
|
-
cls.__testout = TESTOUTPUT
|
|
31
|
-
if os.path.exists(cls.__testout):
|
|
32
|
-
shutil.rmtree(cls.__testout)
|
|
33
|
-
|
|
34
|
-
def setUp(self):
|
|
35
|
-
TOPDIR = os.path.dirname(os.path.dirname(os.path.dirname(self.__here)))
|
|
36
|
-
if not os.path.exists(self.__testout):
|
|
37
|
-
os.makedirs(self.__testout)
|
|
38
|
-
|
|
39
|
-
mockTopPath = os.path.join(TOPDIR, "wwpdb", "mock-data")
|
|
40
|
-
self.__crw = CreateRWTree(mockTopPath, self.__testout)
|
|
41
|
-
|
|
42
|
-
def testCopySiteConfig(self):
|
|
43
|
-
"""Tests creation site-config"""
|
|
44
|
-
self.__crw.createtree(["site-config"])
|
|
45
|
-
self.assertTrue(os.path.exists(os.path.join(self.__testout, "site-config")))
|
|
46
|
-
|
|
47
|
-
def testCopyActionData(self):
|
|
48
|
-
"""Test creation of actiondata.xml"""
|
|
49
|
-
self.__crw.createtree(["actiondata"])
|
|
50
|
-
self.assertTrue(os.path.exists(os.path.join(self.__testout, "da_top", "resources_ro", "actionData.xml")))
|
|
51
|
-
|
|
52
|
-
def testCopyMultiData(self):
|
|
53
|
-
"""Test creation of multiple items"""
|
|
54
|
-
dstdir = os.path.join(self.__testout, "da_top", "webapps")
|
|
55
|
-
if os.path.exists(dstdir):
|
|
56
|
-
shutil.rmtree(dstdir)
|
|
57
|
-
self.__crw.createtree(["depuiresources", "emdresources", "wsresources", ["webapps", "msgmodule"]])
|
|
58
|
-
self.assertTrue(os.path.exists(os.path.join(self.__testout, "da_top", "resources_ro", "depui")))
|
|
59
|
-
self.assertTrue(os.path.exists(os.path.join(self.__testout, "da_top", "resources_ro", "emd")))
|
|
60
|
-
self.assertTrue(os.path.exists(os.path.join(self.__testout, "da_top", "resources_ro", "content_ws")))
|
|
61
|
-
self.assertTrue(os.path.exists(os.path.join(self.__testout, "da_top", "webapps", "htdocs", "msgmodule")))
|
|
62
|
-
self.assertTrue(os.path.exists(os.path.join(self.__testout, "da_top", "webapps", "version.json")))
|
|
63
|
-
|
|
64
|
-
def testCopyVersionOnly(self):
|
|
65
|
-
"""Test creation of version.json webapps"""
|
|
66
|
-
dstdir = os.path.join(self.__testout, "da_top", "webapps")
|
|
67
|
-
if os.path.exists(dstdir):
|
|
68
|
-
shutil.rmtree(dstdir)
|
|
69
|
-
self.__crw.createtree(["webapps"])
|
|
70
|
-
self.assertFalse(os.path.exists(os.path.join(dstdir, "htdocs", "msgmodule")))
|
|
71
|
-
self.assertTrue(os.path.exists(os.path.join(dstdir, "version.json")))
|
|
72
|
-
|
|
73
|
-
def testCopyArchiveData(self):
|
|
74
|
-
"""Test creation of archive data"""
|
|
75
|
-
self.__crw.createtree([["archive", "D_000001"]])
|
|
76
|
-
self.assertTrue(os.path.exists(os.path.join(self.__testout, "da_top", "data", "archive", "D_000001")))
|
|
77
|
-
|
|
78
|
-
def testCopyUnknown(self):
|
|
79
|
-
"""Test creation to log error"""
|
|
80
|
-
self.__crw.createtree(["nothing"])
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
if __name__ == "__main__": # pragma: no cover
|
|
84
|
-
unittest.main()
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
##
|
|
2
|
-
#
|
|
3
|
-
# File: FeaturesTest.py
|
|
4
|
-
# Author: E. Peisach
|
|
5
|
-
# Date: 08-Oct-2018
|
|
6
|
-
# Version: 0.001
|
|
7
|
-
#
|
|
8
|
-
# Updates:
|
|
9
|
-
#
|
|
10
|
-
##
|
|
11
|
-
"""
|
|
12
|
-
Test cases for ensuring skipping of tests works.
|
|
13
|
-
"""
|
|
14
|
-
__docformat__ = "restructuredtext en"
|
|
15
|
-
__author__ = "Ezra Peisach"
|
|
16
|
-
__email__ = "peisach@rcsb.rutgers.edu"
|
|
17
|
-
__license__ = "Creative Commons Attribution 3.0 Unported"
|
|
18
|
-
__version__ = "V0.01"
|
|
19
|
-
|
|
20
|
-
import os
|
|
21
|
-
import unittest
|
|
22
|
-
|
|
23
|
-
from wwpdb.utils.testing.Features import Features
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
class FeaturesTests(unittest.TestCase):
|
|
27
|
-
"""
|
|
28
|
-
Test cases for skipping
|
|
29
|
-
"""
|
|
30
|
-
|
|
31
|
-
def setUp(self):
|
|
32
|
-
pass
|
|
33
|
-
|
|
34
|
-
def tearDown(self):
|
|
35
|
-
pass
|
|
36
|
-
|
|
37
|
-
@unittest.skipUnless(Features().haveApi(), "skipping if lack of API")
|
|
38
|
-
def testHaveApi(self):
|
|
39
|
-
"""Test should be run all the time"""
|
|
40
|
-
self.assertTrue(Features().haveApi())
|
|
41
|
-
|
|
42
|
-
@unittest.skipIf(Features().haveApi(), "requires API to run")
|
|
43
|
-
def testNotHaveApi(self):
|
|
44
|
-
self.fail("Test should have been skipped")
|
|
45
|
-
|
|
46
|
-
@unittest.skipUnless(Features().testNever(), "tests for never execution")
|
|
47
|
-
def testNever(self):
|
|
48
|
-
self.fail("Test should have been skipped")
|
|
49
|
-
|
|
50
|
-
def testMySqlTestServer(self):
|
|
51
|
-
self.assertFalse(Features().haveMySqlTestServer())
|
|
52
|
-
os.environ["MYSQLUP"] = "True"
|
|
53
|
-
self.assertTrue(Features().haveMySqlTestServer())
|
|
54
|
-
del os.environ["MYSQLUP"]
|
|
55
|
-
|
|
56
|
-
def testRbmqTestServer(self):
|
|
57
|
-
# Might need to handle true case
|
|
58
|
-
self.assertFalse(Features().haveRbmqTestServer())
|
|
59
|
-
|
|
60
|
-
def testCvsTestServer(self):
|
|
61
|
-
self.assertFalse(Features().haveCvsTestServer())
|
|
62
|
-
|
|
63
|
-
def testSvnTestServer(self):
|
|
64
|
-
self.assertFalse(Features().haveSvnTestServer())
|
|
65
|
-
|
|
66
|
-
def testSftpTestServer(self):
|
|
67
|
-
self.assertFalse(Features().haveSftpTestServer())
|
|
68
|
-
|
|
69
|
-
def testToolsRuntime(self):
|
|
70
|
-
self.assertFalse(Features().haveToolsRuntime())
|
|
71
|
-
|
|
72
|
-
def testHaveCCD(self):
|
|
73
|
-
self.assertFalse(Features().haveCCD())
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
if __name__ == "__main__": # pragma: no cover
|
|
77
|
-
unittest.main()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{wwpdb_utils_testing-0.18 → wwpdb_utils_testing-0.19}/wwpdb/mock-data/da_top/webapps/version.json
RENAMED
|
File without changes
|
{wwpdb_utils_testing-0.18 → wwpdb_utils_testing-0.19}/wwpdb/mock-data/site-config/common/common.cfg
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{wwpdb_utils_testing-0.18 → wwpdb_utils_testing-0.19}/wwpdb.utils.testing.egg-info/top_level.txt
RENAMED
|
File without changes
|