コード例 #1
0
ファイル: test_ssafile.py プロジェクト: utylee/pysubs2
def test_insertion_of_wrong_type():
    subs = SSAFile()
    subs.append(SSAEvent())

    with assert_raises(TypeError):
        subs.append(42)
    with assert_raises(TypeError):
        subs.insert(42)
    with assert_raises(TypeError):
        subs[0] = 42
コード例 #2
0
ファイル: test_ssafile.py プロジェクト: hpsbranco/pysubs2
def test_insertion_of_wrong_type():
    subs = SSAFile()
    subs.append(SSAEvent())

    with assert_raises(TypeError):
        subs.append(42)
    with assert_raises(TypeError):
        subs.insert(42)
    with assert_raises(TypeError):
        subs[0] = 42