コード例 #1
0
ファイル: test_kclass.py プロジェクト: holyachon/K-Format
 class Something:
     a: N(10)
     b: AN(20)
     other: Other
     others: List[Other]
     c: N(5)
     d: AN(10)
コード例 #2
0
ファイル: test_kproperty.py プロジェクト: banksalad/K-Format
def test_N_to_bytes_with_invalid_length(length, value):
    with pytest.raises(InvalidLengthError) as e:
        assert N(length).to_bytes(value)
    assert 'Invalid length of value is given' in str(e.value)
コード例 #3
0
ファイル: test_kproperty.py プロジェクト: banksalad/K-Format
def test_N_to_bytes_with_filler(length, filler, value, expected):
    assert N(length, filler=filler).to_bytes(value) == expected
コード例 #4
0
ファイル: test_kproperty.py プロジェクト: banksalad/K-Format
def test_N_to_bytes(length, value, expected):
    assert N(length).to_bytes(value) == expected
コード例 #5
0
ファイル: test_kclass.py プロジェクト: holyachon/K-Format
 class Other:
     an: AN(10)
     n: N(5)
コード例 #6
0
ファイル: test_kclass.py プロジェクト: holyachon/K-Format
 class Something:
     n: N(1)
コード例 #7
0
ファイル: test_kclass.py プロジェクト: holyachon/K-Format
 class Other:
     n: N(5)
     an: AN(10)
コード例 #8
0
ファイル: test_kclass.py プロジェクト: holyachon/K-Format
 class Something:
     n: N(10)
     an: AN(20)
     other: Other
     others: List[Other]
     filler: AN(100)