feat: added a basic test texture
This commit is contained in:
@ -23,6 +23,7 @@ import queue
|
|||||||
import random
|
import random
|
||||||
import shutil
|
import shutil
|
||||||
import string
|
import string
|
||||||
|
import sys
|
||||||
import time
|
import time
|
||||||
from operator import itemgetter
|
from operator import itemgetter
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
@ -38,7 +39,7 @@ from replication.exception import NonAuthorizedOperationError
|
|||||||
from replication.interface import session
|
from replication.interface import session
|
||||||
|
|
||||||
from . import bl_types, delayable, environment, ui, utils
|
from . import bl_types, delayable, environment, ui, utils
|
||||||
from .presence import (SessionStatusWidget, renderer, view3d_find)
|
from .presence import SessionStatusWidget, renderer, view3d_find
|
||||||
|
|
||||||
background_execution_queue = Queue()
|
background_execution_queue = Queue()
|
||||||
delayables = []
|
delayables = []
|
||||||
@ -195,9 +196,14 @@ class SessionStartOperator(bpy.types.Operator):
|
|||||||
timout=type_local_config.bl_delay_apply,
|
timout=type_local_config.bl_delay_apply,
|
||||||
target_type=type_module_class))
|
target_type=type_module_class))
|
||||||
|
|
||||||
|
if bpy.app.version[1] >= 91:
|
||||||
|
python_binary_path = sys.executable
|
||||||
|
else:
|
||||||
|
python_binary_path = bpy.app.binary_path_python
|
||||||
|
|
||||||
session.configure(
|
session.configure(
|
||||||
factory=bpy_factory,
|
factory=bpy_factory,
|
||||||
python_path=bpy.app.binary_path_python,
|
python_path=python_binary_path,
|
||||||
external_update_handling=use_extern_update)
|
external_update_handling=use_extern_update)
|
||||||
|
|
||||||
if settings.update_method == 'DEPSGRAPH':
|
if settings.update_method == 'DEPSGRAPH':
|
||||||
|
@ -13,7 +13,7 @@ def main():
|
|||||||
if len(sys.argv) > 2:
|
if len(sys.argv) > 2:
|
||||||
blender_rev = sys.argv[2]
|
blender_rev = sys.argv[2]
|
||||||
else:
|
else:
|
||||||
blender_rev = "2.90.0"
|
blender_rev = "2.91.0"
|
||||||
|
|
||||||
try:
|
try:
|
||||||
exit_val = BAT.test_blender_addon(addon_path=addon, blender_revision=blender_rev)
|
exit_val = BAT.test_blender_addon(addon_path=addon, blender_revision=blender_rev)
|
||||||
|
24
tests/test_bl_types/test_texture.py
Normal file
24
tests/test_bl_types/test_texture.py
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
import os
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
from deepdiff import DeepDiff
|
||||||
|
|
||||||
|
import bpy
|
||||||
|
import random
|
||||||
|
from multi_user.bl_types.bl_texture import BlTexture
|
||||||
|
|
||||||
|
TEXTURE_TYPES = ['NONE', 'BLEND', 'CLOUDS', 'DISTORTED_NOISE', 'IMAGE', 'MAGIC', 'MARBLE', 'MUSGRAVE', 'NOISE', 'STUCCI', 'VORONOI', 'WOOD']
|
||||||
|
|
||||||
|
@pytest.mark.parametrize('texture_type', TEXTURE_TYPES)
|
||||||
|
def test_texture(clear_blend, texture_type):
|
||||||
|
datablock = bpy.data.textures.new('test', texture_type)
|
||||||
|
|
||||||
|
implementation = BlTexture()
|
||||||
|
expected = implementation._dump(datablock)
|
||||||
|
bpy.data.textures.remove(datablock)
|
||||||
|
|
||||||
|
test = implementation._construct(expected)
|
||||||
|
implementation._load(expected, test)
|
||||||
|
result = implementation._dump(test)
|
||||||
|
|
||||||
|
assert not DeepDiff(expected, result)
|
Reference in New Issue
Block a user