#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
- downloads data from (list) of files from GDrive
- checks md5 if file ok
- check file integrity with MD5 hash
- unzips if zip
- 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)
- input
- data - test data (workfiles, images etc)
- dumps - folder for BSOn dumps from (`mongodump`)
- dumps - folder for BSON dumps from (`mongodump`)
- env_vars
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

View file

@ -19,9 +19,9 @@ class DBHandler:
if host:
if all([user, password]):
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.db = None

View file

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