Beispiel #1
0
 def test_getting_an_imperial_name(self):
     bpy.context.scene.unit_settings.system = "IMPERIAL"
     bpy.context.scene.unit_settings.length_unit = "MILES"
     assert subject.get_scene_unit_name("length") == "mile"
     assert subject.get_scene_unit_name("area") == "square mile"
     assert subject.get_scene_unit_name("volume") == "cubic mile"
     bpy.context.scene.unit_settings.length_unit = "FEET"
     assert subject.get_scene_unit_name("length") == "foot"
     assert subject.get_scene_unit_name("area") == "square foot"
     assert subject.get_scene_unit_name("volume") == "cubic foot"
     bpy.context.scene.unit_settings.length_unit = "INCHES"
     assert subject.get_scene_unit_name("length") == "inch"
     assert subject.get_scene_unit_name("area") == "square inch"
     assert subject.get_scene_unit_name("volume") == "cubic inch"
     bpy.context.scene.unit_settings.length_unit = "THOU"
     assert subject.get_scene_unit_name("length") == "thou"
     assert subject.get_scene_unit_name("area") == "square thou"
     assert subject.get_scene_unit_name("volume") == "cubic thou"
     bpy.context.scene.unit_settings.length_unit = "ADAPTIVE"
     assert subject.get_scene_unit_name("length") == "foot"
     assert subject.get_scene_unit_name("area") == "square foot"
     assert subject.get_scene_unit_name("volume") == "cubic foot"
Beispiel #2
0
 def test_getting_a_name_with_no_unit_system(self):
     bpy.context.scene.unit_settings.system = "NONE"
     assert subject.get_scene_unit_name("length") == "METRE"
Beispiel #3
0
 def test_getting_a_metric_name(self):
     bpy.context.scene.unit_settings.system = "METRIC"
     assert subject.get_scene_unit_name("length") == "METRE"
     assert subject.get_scene_unit_name("area") == "SQUARE_METRE"
     assert subject.get_scene_unit_name("volume") == "CUBIC_METRE"