# Path: tessagon/adaptors/list_adaptor.py
# class ListAdaptor:
# 
#     def __init__(self, **kwargs):
#         self.vert_list = None
#         self.face_list = None
#         self.color_list = None
# 
#     def create_empty_mesh(self):
#         self.vert_list = []
#         self.face_list = []
#         self.color_list = []
# 
#     def initialize_colors(self):
#         self.color_list = [0]*len(self.face_list)
# 
#     def create_vert(self, coords):
#         self.vert_list.append(coords)
#         return (len(self.vert_list) - 1)
# 
#     def create_face(self, verts):
#         self.face_list.append(verts)
#         return (len(self.face_list) - 1)
# 
#     def color_face(self, face, color_index):
#         self.color_list[face] = color_index
# 
#     def finish_mesh(self):
#         pass
# 
#     def get_mesh(self):
#         return {'vert_list': self.vert_list,
#                 'face_list': self.face_list,
#                 'color_list': self.color_list}


import os
import sys
from tessagon.adaptors.list_adaptor import ListAdaptor  # noqa: E402

this_dir = os.path.dirname(os.path.realpath(__file__))
sys.path.append(this_dir + '/../..')



class TestListAdaptor:

    def test_create_empty_mesh(self):
        adaptor = ListAdaptor()
        adaptor.create_empty_mesh()
        assert adaptor.vert_list == []
        assert adaptor.face_list == []
        assert adaptor.color_list == []

    def test_create_vert(self):
        adaptor = ListAdaptor()
        adaptor.create_empty_mesh()
        vert0 = adaptor.create_vert([0.0, 1.0, 2.0])
        assert adaptor.vert_list == [[0.0, 1.0, 2.0]]
        assert vert0 == 0
        vert1 = adaptor.create_vert([3.0, 2.0, 1.0])
        assert adaptor.vert_list == [[0.0, 1.0, 2.0],
                                     [3.0, 2.0, 1.0]]
        assert vert1 == 1

    def test_create_face(self):

# Path: tessagon/adaptors/list_adaptor.py
# class ListAdaptor:
# 
#     def __init__(self, **kwargs):
#         self.vert_list = None
#         self.face_list = None
#         self.color_list = None
# 
#     def create_empty_mesh(self):
#         self.vert_list = []
#         self.face_list = []
#         self.color_list = []
# 
#     def initialize_colors(self):
#         self.color_list = [0]*len(self.face_list)
# 
#     def create_vert(self, coords):
#         self.vert_list.append(coords)
#         return (len(self.vert_list) - 1)
# 
#     def create_face(self, verts):
#         self.face_list.append(verts)
#         return (len(self.face_list) - 1)
# 
#     def color_face(self, face, color_index):
#         self.color_list[face] = color_index
# 
#     def finish_mesh(self):
#         pass
# 
#     def get_mesh(self):
#         return {'vert_list': self.vert_list,
#                 'face_list': self.face_list,
#                 'color_list': self.color_list}


# Path: tests/adaptors/test_list_adaptor.py
import os
import sys
from tessagon.adaptors.list_adaptor import ListAdaptor  # noqa: E402


this_dir = os.path.dirname(os.path.realpath(__file__))
sys.path.append(this_dir + '/../..')



class TestListAdaptor:

    def test_create_empty_mesh(self):
        adaptor = ListAdaptor()
        adaptor.create_empty_mesh()
        assert adaptor.vert_list == []
        assert adaptor.face_list == []
        assert adaptor.color_list == []

    def test_create_vert(self):
        adaptor = ListAdaptor()
        adaptor.create_empty_mesh()
        vert0 = adaptor.create_vert([0.0, 1.0, 2.0])
        assert adaptor.vert_list == [[0.0, 1.0, 2.0]]
        assert vert0 == 0
        vert1 = adaptor.create_vert([3.0, 2.0, 1.0])
        assert adaptor.vert_list == [[0.0, 1.0, 2.0],
                                     [3.0, 2.0, 1.0]]
        assert vert1 == 1

    def test_create_face(self):

        adaptor = ListAdaptor()