#1794 - fixes from review

This commit is contained in:
Petr Kalis 2021-09-02 19:01:03 +02:00
parent 216d2ab30e
commit 0b02e5348a
3 changed files with 6 additions and 6 deletions

View file

@ -10,7 +10,7 @@ Folder for libs and tooling for automatic testing.
- file_handler.py - class to download test data from GDrive - file_handler.py - class to download test data from GDrive
- downloads data from (list) of files from GDrive - downloads data from (list) of files from GDrive
- checks md5 if file ok - check file integrity with MD5 hash
- unzips if zip - unzips if zip
- testing_wrapper.py - base class to use for testing - testing_wrapper.py - base class to use for testing
@ -34,11 +34,11 @@ Currently it is expected that test file will be zip file with structure:
- expected - expected files (not implemented yet) - expected - expected files (not implemented yet)
- input - input
- data - test data (workfiles, images etc) - data - test data (workfiles, images etc)
- dumps - folder for BSOn dumps from (`mongodump`) - dumps - folder for BSON dumps from (`mongodump`)
- env_vars - env_vars
env_vars.json - dictionary with environment variables {key:value} env_vars.json - dictionary with environment variables {key:value}
- sql - sql files to load with `mongoimport` (human readable) - json - json files to load with `mongoimport` (human readable)
Example Example

View file

@ -19,9 +19,9 @@ class DBHandler:
if host: if host:
if all([user, password]): if all([user, password]):
host = "{}:{}@{}".format(user, password, host) host = "{}:{}@{}".format(user, password, host)
uri = 'mongodb://{}:{}'.format(host, port or 27017) self.uri = 'mongodb://{}:{}'.format(host, port or 27017)
assert uri, "Must have uri to MongoDB" assert self.uri, "Must have uri to MongoDB"
self.client = pymongo.MongoClient(uri) self.client = pymongo.MongoClient(uri)
self.db = None self.db = None

View file

@ -88,7 +88,7 @@ class TestCase:
all_vars.update(vars(TestCase)) # TODO check all_vars.update(vars(TestCase)) # TODO check
value = value.format(**all_vars) value = value.format(**all_vars)
print("Setting {}:{}".format(key, value)) print("Setting {}:{}".format(key, value))
monkeypatch_session.setenv(key, value) monkeypatch_session.setenv(key, str(value))
import openpype import openpype
openpype_root = os.path.dirname(os.path.dirname(openpype.__file__)) openpype_root = os.path.dirname(os.path.dirname(openpype.__file__))