Cleanup: strip tests trailing space

This commit is contained in:
Campbell Barton
2018-06-04 18:47:31 +02:00
parent 747534af00
commit f6740993f7
7 changed files with 133 additions and 133 deletions

View File

@@ -40,7 +40,7 @@ TEST(heap, One)
const char *in = "test";
heap = BLI_heap_new();
BLI_heap_insert(heap, 0.0f, (void *)in);
EXPECT_FALSE(BLI_heap_is_empty(heap));
EXPECT_EQ(BLI_heap_len(heap), 1);

View File

@@ -127,7 +127,7 @@ class MatrixTesting(unittest.TestCase):
(0, 0, 0, 1)))
vec = Vector((1, 2, 3))
prod_mat_vec = Vector((7, 12, 4))
prod_vec_mat = Vector((1, 12, 5))

View File

@@ -113,37 +113,37 @@ class MeshExportTest4(AbstractColladaTest):
test = "suzannes_parent_inverse_sample_10_matrix"
reference_dae = self.testdir / Path("%s.dae" % test)
outfile = tempdir / Path("%s_out.dae" % test)
bpy.ops.wm.collada_export(filepath="%s" % str(outfile),
check_existing=True,
filemode=8,
display_type='DEFAULT',
sort_method='FILE_SORT_ALPHA',
apply_modifiers=True,
export_mesh_type=0,
export_mesh_type_selection='view',
selected=True,
include_children=True,
include_armatures=True,
include_shapekeys=False,
deform_bones_only=False,
include_animations=True,
sample_animations=True,
sampling_rate=10,
active_uv_only=False,
use_texture_copies=True,
triangulate=False,
use_object_instantiation=True,
use_blender_profile=True,
sort_by_name=False,
export_transformation_type=0,
export_transformation_type_selection='matrix',
export_texture_type=0,
export_texture_type_selection='mat',
open_sim=False,
limit_precision=True,
check_existing=True,
filemode=8,
display_type='DEFAULT',
sort_method='FILE_SORT_ALPHA',
apply_modifiers=True,
export_mesh_type=0,
export_mesh_type_selection='view',
selected=True,
include_children=True,
include_armatures=True,
include_shapekeys=False,
deform_bones_only=False,
include_animations=True,
sample_animations=True,
sampling_rate=10,
active_uv_only=False,
use_texture_copies=True,
triangulate=False,
use_object_instantiation=True,
use_blender_profile=True,
sort_by_name=False,
export_transformation_type=0,
export_transformation_type_selection='matrix',
export_texture_type=0,
export_texture_type_selection='mat',
open_sim=False,
limit_precision=True,
keep_bind_info=False)
# Now check the resulting Collada file.
if not self.checkdae(reference_dae, outfile):
self.fail()
@@ -154,37 +154,37 @@ class MeshExportTest3(AbstractColladaTest):
test = "suzannes_parent_inverse_sample_10_channels"
reference_dae = self.testdir / Path("%s.dae" % test)
outfile = tempdir / Path("%s_out.dae" % test)
bpy.ops.wm.collada_export(filepath="%s" % str(outfile),
check_existing=True,
filemode=8,
display_type='DEFAULT',
sort_method='FILE_SORT_ALPHA',
apply_modifiers=True,
export_mesh_type=0,
export_mesh_type_selection='view',
selected=True,
include_children=True,
include_armatures=True,
include_shapekeys=False,
deform_bones_only=False,
include_animations=True,
sample_animations=True,
sampling_rate=10,
active_uv_only=False,
use_texture_copies=True,
triangulate=False,
use_object_instantiation=True,
use_blender_profile=True,
sort_by_name=False,
export_transformation_type=0,
export_transformation_type_selection='transrotloc',
export_texture_type=0,
export_texture_type_selection='mat',
open_sim=False,
limit_precision=True,
check_existing=True,
filemode=8,
display_type='DEFAULT',
sort_method='FILE_SORT_ALPHA',
apply_modifiers=True,
export_mesh_type=0,
export_mesh_type_selection='view',
selected=True,
include_children=True,
include_armatures=True,
include_shapekeys=False,
deform_bones_only=False,
include_animations=True,
sample_animations=True,
sampling_rate=10,
active_uv_only=False,
use_texture_copies=True,
triangulate=False,
use_object_instantiation=True,
use_blender_profile=True,
sort_by_name=False,
export_transformation_type=0,
export_transformation_type_selection='transrotloc',
export_texture_type=0,
export_texture_type_selection='mat',
open_sim=False,
limit_precision=True,
keep_bind_info=False)
# Now check the resulting Collada file.
if not self.checkdae(reference_dae, outfile):
self.fail()
@@ -195,37 +195,37 @@ class MeshExportTest2(AbstractColladaTest):
test = "suzannes_parent_inverse_keyframes_matrix"
reference_dae = self.testdir / Path("%s.dae" % test)
outfile = tempdir / Path("%s_out.dae" % test)
bpy.ops.wm.collada_export(filepath="%s" % str(outfile),
check_existing=True,
filemode=8,
display_type='DEFAULT',
sort_method='FILE_SORT_ALPHA',
apply_modifiers=True,
export_mesh_type=0,
export_mesh_type_selection='view',
selected=True,
include_children=True,
include_armatures=True,
include_shapekeys=False,
deform_bones_only=False,
include_animations=True,
sample_animations=False,
sampling_rate=1,
active_uv_only=False,
use_texture_copies=True,
triangulate=False,
use_object_instantiation=True,
use_blender_profile=True,
sort_by_name=False,
export_transformation_type=0,
export_transformation_type_selection='matrix',
export_texture_type=0,
export_texture_type_selection='mat',
open_sim=False,
limit_precision=True,
check_existing=True,
filemode=8,
display_type='DEFAULT',
sort_method='FILE_SORT_ALPHA',
apply_modifiers=True,
export_mesh_type=0,
export_mesh_type_selection='view',
selected=True,
include_children=True,
include_armatures=True,
include_shapekeys=False,
deform_bones_only=False,
include_animations=True,
sample_animations=False,
sampling_rate=1,
active_uv_only=False,
use_texture_copies=True,
triangulate=False,
use_object_instantiation=True,
use_blender_profile=True,
sort_by_name=False,
export_transformation_type=0,
export_transformation_type_selection='matrix',
export_texture_type=0,
export_texture_type_selection='mat',
open_sim=False,
limit_precision=True,
keep_bind_info=False)
# Now check the resulting Collada file.
if not self.checkdae(reference_dae, outfile):
self.fail()
@@ -236,45 +236,45 @@ class MeshExportTest1(AbstractColladaTest):
test = "suzannes_parent_inverse_keyframes_channels"
reference_dae = self.testdir / Path("%s.dae" % test)
outfile = tempdir / Path("%s_out.dae" % test)
bpy.ops.wm.collada_export(filepath="%s" % str(outfile),
check_existing=True,
filemode=8,
display_type='DEFAULT',
sort_method='FILE_SORT_ALPHA',
apply_modifiers=True,
export_mesh_type=0,
export_mesh_type_selection='view',
selected=True,
include_children=True,
include_armatures=True,
include_shapekeys=False,
deform_bones_only=False,
include_animations=True,
sample_animations=False,
sampling_rate=1,
active_uv_only=False,
use_texture_copies=True,
triangulate=False,
use_object_instantiation=True,
use_blender_profile=True,
sort_by_name=False,
export_transformation_type=0,
export_transformation_type_selection='transrotloc',
export_texture_type=0,
export_texture_type_selection='mat',
open_sim=False,
limit_precision=True,
check_existing=True,
filemode=8,
display_type='DEFAULT',
sort_method='FILE_SORT_ALPHA',
apply_modifiers=True,
export_mesh_type=0,
export_mesh_type_selection='view',
selected=True,
include_children=True,
include_armatures=True,
include_shapekeys=False,
deform_bones_only=False,
include_animations=True,
sample_animations=False,
sampling_rate=1,
active_uv_only=False,
use_texture_copies=True,
triangulate=False,
use_object_instantiation=True,
use_blender_profile=True,
sort_by_name=False,
export_transformation_type=0,
export_transformation_type_selection='transrotloc',
export_texture_type=0,
export_texture_type_selection='mat',
open_sim=False,
limit_precision=True,
keep_bind_info=False)
# Now check the resulting Collada file.
if not self.checkdae(reference_dae, outfile):
self.fail()
if __name__ == '__main__':
sys.argv = [__file__] + (sys.argv[sys.argv.index("--") + 1:] if "--" in sys.argv else [])
parser = argparse.ArgumentParser()
parser.add_argument('--testdir', required=True)
args, remaining = parser.parse_known_args()
unittest.main(argv=sys.argv[0:1]+remaining)
unittest.main(argv=sys.argv[0:1]+remaining)

View File

@@ -113,7 +113,7 @@ class MeshExportTest(AbstractColladaTest):
test = "mesh_simple_001"
reference_dae = self.testdir / Path("%s.dae" % test)
outfile = tempdir / Path("%s_out.dae" % test)
bpy.ops.wm.collada_export(filepath="%s" % str(outfile),
check_existing=True,
filemode=8,
@@ -141,7 +141,7 @@ class MeshExportTest(AbstractColladaTest):
open_sim=False,
limit_precision=False,
keep_bind_info=False)
# Now check the resulting Collada file.
if not self.checkdae(reference_dae, outfile):
self.fail()
@@ -151,4 +151,4 @@ if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--testdir', required=True)
args, remaining = parser.parse_known_args()
unittest.main(argv=sys.argv[0:1]+remaining)
unittest.main(argv=sys.argv[0:1]+remaining)

View File

@@ -60,7 +60,7 @@ class AbstractFFmpegSequencerTest(AbstractFFmpegTest):
class FPSDetectionTest(AbstractFFmpegSequencerTest):
def test_T51153(self):
self.assertAlmostEqual(
self.get_movie_file_fps('T51153_bad_clip_2.mts'),
self.get_movie_file_fps('T51153_bad_clip_2.mts'),
29.97,
places=2)

View File

@@ -61,7 +61,7 @@ class AbstractBlenderRunnerTest(unittest.TestCase):
# Set in a subclass
blender: pathlib.Path = None
testdir: pathlib.Path = None
def run_blender(self, filepath: str, python_script: str, timeout: int=300) -> str:
"""Runs Blender by opening a blendfile and executing a script.

View File

@@ -23,7 +23,7 @@ class TestArray(unittest.TestCase):
test.farr= (1.0, 2.0, 3.0)
test.iarr= (7, 8, 9)
test.barr= (False, True, False)
# test access
# test slice access, negative indices
def test_access(self):
@@ -40,7 +40,7 @@ class TestArray(unittest.TestCase):
def test_access_fail(self):
for arr in (test.farr, test.iarr, test.barr):
self.assertRaises(IndexError, lambda : arr[4])
# test assignment of a whole array
def test_assign_array(self):
# should accept int as float
@@ -83,7 +83,7 @@ class TestArray(unittest.TestCase):
for i in range(len(arr)):
val= rand_func()
arr[i] = val
self.assertEqual(arr[i], val)
# float prop should accept also int
@@ -92,7 +92,7 @@ class TestArray(unittest.TestCase):
test.farr[i] = val
self.assertEqual(test.farr[i], float(val))
#
#
def test_assign_item_fail(self):
def assign_bad_index(arr):
@@ -100,12 +100,12 @@ class TestArray(unittest.TestCase):
def assign_bad_type(arr):
arr[1] = "123"
for arr in [test.farr, test.iarr, test.barr]:
self.assertRaises(IndexError, assign_bad_index, arr)
# not testing bool because bool allows not only (True|False)
for arr in [test.farr, test.iarr]:
for arr in [test.farr, test.iarr]:
self.assertRaises(TypeError, assign_bad_type, arr)
def test_dynamic_assign_array(self):
@@ -118,7 +118,7 @@ class TestArray(unittest.TestCase):
def test_dynamic_assign_array_fail(self):
# could also test too big length here
def assign_empty_list(arr):
setattr(test, arr, ())
@@ -236,7 +236,7 @@ def make_random_array(len, rand_func):
arr= []
for i in range(len):
arr.append(rand_func())
return arr
def make_random_2d_array(dimsize, rand_func):