コード例 #1
0
 def test_can_get_audio_file_duration(self):
     test_path_structure_to_file_duration_in_msec_map = {
         ("83a9787d4cb6f3b7632b4ddfebf74367_pop.wav"): 23,
         ("83c36d806dc92327b9e7049a565c6bff_meow.wav"): 847,
     }
     for test_path_structure, expected_duration_in_msec in test_path_structure_to_file_duration_in_msec_map.iteritems():
         audio_file_path = common_testing.get_test_resources_path(*("wav_pcm", test_path_structure))
         assert os.path.exists(audio_file_path)
         self.assertAlmostEqual(common.length_of_audio_file_in_secs(audio_file_path), expected_duration_in_msec / 1000.0, delta=0.001)
コード例 #2
0
 def test_can_get_audio_file_duration(self):
     test_path_structure_to_file_duration_in_msec_map = {
         ("83a9787d4cb6f3b7632b4ddfebf74367_pop.wav"): 23,
         ("83c36d806dc92327b9e7049a565c6bff_meow.wav"): 847,
     }
     for test_path_structure, expected_duration_in_msec in test_path_structure_to_file_duration_in_msec_map.iteritems(
     ):
         audio_file_path = common_testing.get_test_resources_path(
             *("wav_pcm", test_path_structure))
         assert os.path.exists(audio_file_path)
         self.assertAlmostEqual(
             common.length_of_audio_file_in_secs(audio_file_path),
             expected_duration_in_msec / 1000.0,
             delta=0.001)
コード例 #3
0
 def test_can_access_project_variables(self):
     variables_test_code_content = common.content_of(common_testing.get_test_resources_path("scratch_code_only", "variables_test.json"))
     raw_project = scratch.RawProject.from_project_code_content(variables_test_code_content)
     assert [variable["name"] for variable in raw_project.get_variables()] == ["$", "MarketOpen", "Multiplier", "bc1bought", "bc2bought"]
コード例 #4
0
 def test_can_access_project_variables(self):
     variables_test_code_content = common.content_of(common_testing.get_test_resources_path("scratch_code_only", "variables_test.json"))
     raw_project = scratch.RawProject.from_project_code_content(variables_test_code_content)
     assert [variable["name"] for variable in raw_project.get_variables()] == ["$", "MarketOpen", "Multiplier", "bc1bought", "bc2bought"]
コード例 #5
0
 def img_proc_pngfile_output_path(cls, fileName):
     return os.path.join(common_testing.get_test_resources_path(), "img_proc_png", fileName)