Ejemplo n.º 1
0
def test_find_partial_video_inside_another(intro_file):
    # This is cut from the one minute mark of intro_file
    # and last for 2 min
    part = os.path.join(TEST_DATA, 'part.mkv')

    # Check the parts file by file.
    part_hashes = list(credits.hash_file(part, frame_range=False))
    intro_hashes = list(credits.hash_file(intro_file, frame_range=True))

    for straw, sms, i, pms, _, z in credits.find_hashes(part_hashes,
                                                        intro_hashes,
                                                        no_dupe_frames=True):
        sms_sec = math.floor(sms / 1000)
        pms_sec = math.floor(pms / 1000)

        assert sms_sec >= 60 and sms_sec <= 180
        assert pms_sec >= 0 and pms_sec <= 120
        print('%r %s %s' % (straw, misc.sec_to_hh_mm_ss(sms_sec),
                            misc.sec_to_hh_mm_ss(pms_sec)))
Ejemplo n.º 2
0
def test_sec_to_hh_mm_ss():
    x = misc.sec_to_hh_mm_ss(60)
    assert x == '00:01:00'