Update unit test "activate addon" to be independent with the addon name
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import unittest
|
||||
import bpy
|
||||
import glob
|
||||
import os
|
||||
|
||||
|
||||
class ActivateAddon(unittest.TestCase):
|
||||
@@ -8,9 +10,15 @@ class ActivateAddon(unittest.TestCase):
|
||||
def setUp(self) -> None:
|
||||
pass
|
||||
|
||||
@staticmethod
|
||||
def get_folder_name():
|
||||
"""Return the folder name to get the addon name we want activated"""
|
||||
addon = glob.glob("/addon-moderlab/*/__init__.py", recursive=True)
|
||||
return os.path.basename(os.path.dirname(addon[0]))
|
||||
|
||||
def test_activate_addon(self):
|
||||
"""Activate the blender addon 'moderlab_plugin'"""
|
||||
addon = bpy.ops.preferences.addon_enable(module='moderlab_type')
|
||||
addon = bpy.ops.preferences.addon_enable(module=self.get_folder_name())
|
||||
self.assertEqual({'FINISHED'}, addon)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user