2 from os
.path
import exists
3 from shutil
import rmtree
4 from unittest
import TestCase
5 from itertools
import product
6 from ya2
.build
.models
import ModelsBuilder
9 class ModelsBuilderTests(TestCase
):
12 self
.__test
_directories
= ['cube1', 'cube2']
13 for f_d
in product(['bam', 'gltf'], self
.__test
_directories
):
14 rmtree('tests/assets/models/%s/%s' % f_d
, ignore_errors
=True)
16 def test_models(self
):
17 if environ
.get('FAST') == '1': self
.skipTest('skipped slow tests')
18 for f_d
in product(['bam', 'gltf'], self
.__test
_directories
):
19 self
.assertFalse(exists('tests/assets/%s/%s' % f_d
))
20 b
= ModelsBuilder('tests/assets/models', 1)
22 self
.assertGreater(len(built
), 0)
24 'tests/assets/models/bam/cube1/cube.bam',
25 'tests/assets/models/bam/cube1/diffuse.dds',
26 'tests/assets/models/bam/cube2/cube.bam',
27 'tests/assets/models/bam/cube2/diffuse.dds']
28 [self
.assertTrue(exists(f
)) for f
in test_files
]
29 b
= ModelsBuilder('tests/assets/models', 1)
31 self
.assertEqual(len(built
), 0)