Beispiel #1
0
 def test_convert_bad_input_file_arg(self):
   with self.assertRaises(ValueError):
     tt.main(["convert", 
       "-i", "src/test/resources/ttml/body_only.ttml", 
       "-o", "build/body_only.out.ttml", 
       "--itype", "not_ttml", 
       "--config_file", "src/test/resources/config_files/unit_test_cfg.json"])
Beispiel #2
0
 def test_convert(self):
     # Note passing in the args using split
     # This gets processed as 2 args being passed into
     # the main function
     #
     tt.main(
         "convert -i src/test/resources/ttml/body_only.ttml -o build/body_only.out.ttml"
         .split())
Beispiel #3
0
 def test_mix_rows_roll_up_scc(self):
     tt.main(
         "convert -i src/test/resources/scc/mix-rows-roll-up.scc -o build/mix-rows-roll-up.ttml"
         .split())
     self.assertTrue(os.path.exists("build/mix-rows-roll-up.ttml"))
     tt.main(
         "convert -i src/test/resources/scc/mix-rows-roll-up.scc -o build/mix-rows-roll-up.srt"
         .split())
     self.assertTrue(os.path.exists("build/mix-rows-roll-up.srt"))
Beispiel #4
0
 def test_pop_on_scc(self):
     tt.main(
         "convert -i src/test/resources/scc/pop-on.scc -o build/pop-on.ttml"
         .split())
     self.assertTrue(os.path.exists("build/pop-on.ttml"))
     tt.main(
         "convert -i src/test/resources/scc/pop-on.scc -o build/pop-on.srt".
         split())
     self.assertTrue(os.path.exists("build/pop-on.srt"))
Beispiel #5
0
  def test_bad_function(self):

    stdout = io.StringIO()
    stderr = io.StringIO()
    with redirect_stdout(stdout), redirect_stderr(stderr):
      # Note passing a bad function name
      #
      with self.assertRaises(SystemExit):
        tt.main("covert")
Beispiel #6
0
 def test_mix_rows_roll_up_scc(self):
   tt.main(["convert", 
     "-i", "src/test/resources/scc/mix-rows-roll-up.scc", 
     "-o", "build/mix-rows-roll-up.ttml", 
     "--config_file", "src/test/resources/config_files/unit_test_cfg.json"])
   self.assertTrue(os.path.exists("build/mix-rows-roll-up.ttml"))
   tt.main(["convert", 
     "-i", "src/test/resources/scc/mix-rows-roll-up.scc", 
     "-o", "build/mix-rows-roll-up.srt", 
     "--config_file", "src/test/resources/config_files/unit_test_cfg.json"])
   self.assertTrue(os.path.exists("build/mix-rows-roll-up.srt"))
Beispiel #7
0
 def test_paint_on_scc(self):
   tt.main(["convert", 
     "-i", "src/test/resources/scc/paint-on.scc", 
     "-o", "build/paint-on.ttml", 
     "--config_file", "src/test/resources/config_files/unit_test_cfg.json"])
   self.assertTrue(os.path.exists("build/paint-on.ttml"))
   tt.main(["convert", 
     "-i", "src/test/resources/scc/paint-on.scc", 
     "-o", "build/paint-on.srt", 
     "--config_file", "src/test/resources/config_files/unit_test_cfg.json"])
   self.assertTrue(os.path.exists("build/paint-on.srt"))
Beispiel #8
0
 def test_convert_mismtach_file_type_and_file_name(self):
   tt.main(["convert", 
     "-i", "src/test/resources/ttml/body_only.ttml", 
     "--itype", "scc", 
     "-o", "build/body_only123.out.ttml", 
     "--config_file", "src/test/resources/config_files/unit_test_cfg.json"])
Beispiel #9
0
 def test_convert_input_file_type_scc(self):
   tt.main(["convert", 
     "-i", "src/test/resources/scc/pop-on.scc",
     "--itype", "scc", 
     "-o", "build/pop-on.out.ttml", 
     "--config_file", "src/test/resources/config_files/unit_test_cfg.json"])
Beispiel #10
0
 def test_convert_output_file_type_TTML(self):
   tt.main(["convert",
     "-i", "src/test/resources/ttml/body_only.ttml",
     "-o", "build/body_only.out.ttml",
     "--otype", "TTML",
     "--config_file", "src/test/resources/config_files/unit_test_cfg.json"])
Beispiel #11
0
 def test_with_config_file(self):
   tt.main(["convert", 
     "-i", "src/test/resources/ttml/body_only.ttml", 
     "-o", "build/body_only.out.ttml", 
     "--config_file", "src/test/resources/config_files/unit_test_cfg.json"])
Beispiel #12
0
 def test_with_config(self):
   tt.main(['convert', 
     '-i', 'src/test/resources/ttml/body_only.ttml', 
     '-o', 'build/body_only.out.ttml', 
     '--config', '{"general": {"progress_bar":false, "log_level":"WARN"}}'])
Beispiel #13
0
 def test_validate(self):
     # Note passing in the args using split
     # This gets processed as 2 args being passed into
     # the main function
     #
     tt.main("validate -i src/test/resources/ttml/body_only.ttml".split())
Beispiel #14
0
 def test_convert_mismtach_file_type_and_file_name(self):
     tt.main(
         "convert -i src/test/resources/ttml/body_only.ttml --itype scc -o build/body_only123.out.ttml"
         .split())
Beispiel #15
0
 def test_convert_bad_output_file_arg(self):
     with self.assertRaises(ValueError):
         tt.main(
             "convert -i src/test/resources/ttml/body_only.ttml -o build/body_only.out.not_ttml --otype not_ttml"
             .split())
Beispiel #16
0
 def test_convert_input_file_type_scc(self):
     tt.main(
         "convert -i src/test/resources/scc/pop-on.scc --itype scc -o build/pop-on.out.ttml"
         .split())
Beispiel #17
0
 def test_convert_output_file_type_ttml(self):
     tt.main(
         "convert -i src/test/resources/ttml/body_only.ttml -o build/body_only.out.ttml --otype ttml"
         .split())