File: TestOBJReader.py

package info (click to toggle)
uranium 3.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 5,876 kB
  • sloc: python: 22,349; sh: 111; makefile: 11
file content (16 lines) | stat: -rw-r--r-- 542 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import os.path

import OBJReader

test_path = os.path.join(os.path.dirname(OBJReader.__file__), "tests")

def test_readOBJ():
    reader = OBJReader.OBJReader()
    sphere_file = os.path.join(test_path, "sphere.obj")
    result = reader.read(sphere_file)

    assert result  # It must return a node
    assert result.getMeshData()  # It should have mesh data
    assert result.getMeshData().getVertexCount() == 3840
    assert result.getMeshData().getFaceCount() == 1280
    assert result.getMeshData().hasNormals()  # It should have normals.