<commit_before>"""Export and import bound meshes."""

import bpy
import nose.tools
import os

import io_scene_nif.nif_export
from pyffi.formats.nif import NifFormat
from test.geometry.trishape.test_geometry import TestBaseGeometry


class TestBound(TestBaseGeometry):
    n_name = "collisions/boundbox/bound_box"
    b_name = "Bounding Box"

    def b_create_objects(self):
        b_obj = self.b_create_base_geometry()
        b_obj.draw_bounds_type = 'BOX'
        b_obj.draw_type = 'BOUNDS'

    def n_create_data(self):
        n_data = TestBaseGeometry.n_create_data()
        # TODO add bounding box
        raise NotImplementedError

    def b_check_data(self):
        b_bbox = bpy.data.objects[self.b_name]
        nose.tools.assert_equal(b_bbox.draw_bounds_type, 'BOX')
        nose.tools.assert_equal(b_bbox.draw_type, 'BOUNDS')

    def n_check_data(self, n_data):
        raise NotImplementedError
        '''
        n_geom = n_data.roots[0].children[0]
        nose.tools.assert_equal(bbox.has_bounding_box, True)
        '''

'''
class TestBSBound(TestBaseGeometry):
    n_name = "collisions/boundbox/bsbound"
    b_name = "BSBound"

    def b_create_objects(self):
        b_obj = TestBaseGeometry.b_create_object(self)
        b_obj.name = self.b_name

        b_obj.draw_bounds_type = 'BOX'
        b_obj.draw_type = 'BOUNDS'

        return b_obj



    def b_check_data(self):
        pass


        b_bbox = b_obj[b_name]
        nose.tools.assert_equal(b_bbox.draw_bounds_type, 'BOX')
        nose.tools.assert_equal(b_bbox.draw_type, 'BOUNDS')


    def n_check_data(self, n_data):
        pass

<commit_msg>Update boundbox test to use python code.<commit_after>"""Export and import bound meshes."""

import bpy
import nose.tools
import os

import io_scene_nif.nif_export
from pyffi.formats.nif import NifFormat
from test import SingleNif
from test.collisions import gen_boundbox


class TestBBox(SingleNif):
    n_name = "collisions/boundbox"
    b_name = "BBoxTest"

    def b_create_objects(self):
        # TODO
        # b_obj = self.b_create_base_geometry()
        bpy.ops.mesh.primitive_cube_add()
        b_obj = bpy.data.objects[bpy.context.active_object.name]
        b_obj.name = self.b_name
        b_obj.draw_bounds_type = 'BOX'
        b_obj.draw_type = 'BOUNDS'
        b_obj.data.show_double_sided = False

    def n_create_data(self):
        return gen_boundbox.n_create_data()

    def b_check_data(self):
        b_bbox = bpy.data.objects[self.b_name]
        nose.tools.assert_equal(b_bbox.draw_bounds_type, 'BOX')
        nose.tools.assert_equal(b_bbox.draw_type, 'BOUNDS')

    def n_check_data(self, n_data):
        n_bbox = n_data.roots[0].children[0]
        nose.tools.assert_equal(n_bbox.has_bounding_box, True)

'''
class TestBSBound(TestBaseGeometry):
    n_name = "collisions/boundbox/bsbound"
    b_name = "BSBound"

    def b_create_objects(self):
        b_obj = TestBaseGeometry.b_create_object(self)
        b_obj.name = self.b_name

        b_obj.draw_bounds_type = 'BOX'
        b_obj.draw_type = 'BOUNDS'

        return b_obj



    def b_check_data(self):
        pass


        b_bbox = b_obj[b_name]
        nose.tools.assert_equal(b_bbox.draw_bounds_type, 'BOX')
        nose.tools.assert_equal(b_bbox.draw_type, 'BOUNDS')


    def n_check_data(self, n_data):
        pass


{'fraction_non_alphanumeric': 0.09715994020926756, 'fraction_numerical': 0.001195814648729447, 'mean_word_length': 2.9785969084423307, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5386214', 'n_tokens_mistral': 1233, 'n_tokens_neox': 1197, 'n_words': 197}