Python numpy.lib.format.magic() Examples

The following are code examples for showing how to use numpy.lib.format.magic(). They are from open source Python projects. You can vote up the examples you like or vote down the ones you don't like.

Example 1
Project: LaserTOF   Author: kyleuckert   File: test_format.py    MIT License 5 votes vote down vote up
def test_read_magic_bad_magic():
    for magic in malformed_magic:
        f = BytesIO(magic)
        yield raises(ValueError)(format.read_magic), f 
Example 2
Project: LaserTOF   Author: kyleuckert   File: test_format.py    MIT License 5 votes vote down vote up
def test_read_version_1_0_bad_magic():
    for magic in bad_version_magic + malformed_magic:
        f = BytesIO(magic)
        yield raises(ValueError)(format.read_array), f 
Example 3
Project: LaserTOF   Author: kyleuckert   File: test_format.py    MIT License 5 votes vote down vote up
def test_bad_magic_args():
    assert_raises(ValueError, format.magic, -1, 1)
    assert_raises(ValueError, format.magic, 256, 1)
    assert_raises(ValueError, format.magic, 1, -1)
    assert_raises(ValueError, format.magic, 1, 256) 
Example 4
Project: FX-RER-Value-Extraction   Author: tsKenneth   File: test_format.py    MIT License 5 votes vote down vote up
def test_read_magic_bad_magic():
    for magic in malformed_magic:
        f = BytesIO(magic)
        assert_raises(ValueError, format.read_array, f) 
Example 5
Project: FX-RER-Value-Extraction   Author: tsKenneth   File: test_format.py    MIT License 5 votes vote down vote up
def test_read_version_1_0_bad_magic():
    for magic in bad_version_magic + malformed_magic:
        f = BytesIO(magic)
        assert_raises(ValueError, format.read_array, f) 
Example 6
Project: FX-RER-Value-Extraction   Author: tsKenneth   File: test_format.py    MIT License 5 votes vote down vote up
def test_bad_magic_args():
    assert_raises(ValueError, format.magic, -1, 1)
    assert_raises(ValueError, format.magic, 256, 1)
    assert_raises(ValueError, format.magic, 1, -1)
    assert_raises(ValueError, format.magic, 1, 256) 
Example 7
Project: recruit   Author: Frank-qlu   File: test_format.py    Apache License 2.0 5 votes vote down vote up
def test_read_magic_bad_magic():
    for magic in malformed_magic:
        f = BytesIO(magic)
        assert_raises(ValueError, format.read_array, f) 
Example 8
Project: recruit   Author: Frank-qlu   File: test_format.py    Apache License 2.0 5 votes vote down vote up
def test_read_version_1_0_bad_magic():
    for magic in bad_version_magic + malformed_magic:
        f = BytesIO(magic)
        assert_raises(ValueError, format.read_array, f) 
Example 9
Project: recruit   Author: Frank-qlu   File: test_format.py    Apache License 2.0 5 votes vote down vote up
def test_bad_magic_args():
    assert_raises(ValueError, format.magic, -1, 1)
    assert_raises(ValueError, format.magic, 256, 1)
    assert_raises(ValueError, format.magic, 1, -1)
    assert_raises(ValueError, format.magic, 1, 256) 
Example 10
Project: FUTU_Stop_Loss   Author: BigtoC   File: test_format.py    MIT License 5 votes vote down vote up
def test_read_magic_bad_magic():
    for magic in malformed_magic:
        f = BytesIO(magic)
        assert_raises(ValueError, format.read_array, f) 
Example 11
Project: FUTU_Stop_Loss   Author: BigtoC   File: test_format.py    MIT License 5 votes vote down vote up
def test_read_version_1_0_bad_magic():
    for magic in bad_version_magic + malformed_magic:
        f = BytesIO(magic)
        assert_raises(ValueError, format.read_array, f) 
Example 12
Project: FUTU_Stop_Loss   Author: BigtoC   File: test_format.py    MIT License 5 votes vote down vote up
def test_bad_magic_args():
    assert_raises(ValueError, format.magic, -1, 1)
    assert_raises(ValueError, format.magic, 256, 1)
    assert_raises(ValueError, format.magic, 1, -1)
    assert_raises(ValueError, format.magic, 1, 256) 
Example 13
Project: MARRtino-2.0   Author: DaniAffCH   File: test_format.py    GNU General Public License v3.0 5 votes vote down vote up
def test_read_magic_bad_magic():
    for magic in malformed_magic:
        f = BytesIO(magic)
        assert_raises(ValueError, format.read_array, f) 
Example 14
Project: MARRtino-2.0   Author: DaniAffCH   File: test_format.py    GNU General Public License v3.0 5 votes vote down vote up
def test_read_version_1_0_bad_magic():
    for magic in bad_version_magic + malformed_magic:
        f = BytesIO(magic)
        assert_raises(ValueError, format.read_array, f) 
Example 15
Project: MARRtino-2.0   Author: DaniAffCH   File: test_format.py    GNU General Public License v3.0 5 votes vote down vote up
def test_bad_magic_args():
    assert_raises(ValueError, format.magic, -1, 1)
    assert_raises(ValueError, format.magic, 256, 1)
    assert_raises(ValueError, format.magic, 1, -1)
    assert_raises(ValueError, format.magic, 1, 256) 
Example 16
Project: auto-alt-text-lambda-api   Author: abhisuri97   File: test_format.py    MIT License 5 votes vote down vote up
def test_read_magic_bad_magic():
    for magic in malformed_magic:
        f = BytesIO(magic)
        yield raises(ValueError)(format.read_magic), f 
Example 17
Project: auto-alt-text-lambda-api   Author: abhisuri97   File: test_format.py    MIT License 5 votes vote down vote up
def test_read_version_1_0_bad_magic():
    for magic in bad_version_magic + malformed_magic:
        f = BytesIO(magic)
        yield raises(ValueError)(format.read_array), f 
Example 18
Project: auto-alt-text-lambda-api   Author: abhisuri97   File: test_format.py    MIT License 5 votes vote down vote up
def test_bad_magic_args():
    assert_raises(ValueError, format.magic, -1, 1)
    assert_raises(ValueError, format.magic, 256, 1)
    assert_raises(ValueError, format.magic, 1, -1)
    assert_raises(ValueError, format.magic, 1, 256) 
Example 19
Project: vnpy_crypto   Author: birforce   File: test_format.py    MIT License 5 votes vote down vote up
def test_read_magic_bad_magic():
    for magic in malformed_magic:
        f = BytesIO(magic)
        yield raises(ValueError)(format.read_magic), f 
Example 20
Project: vnpy_crypto   Author: birforce   File: test_format.py    MIT License 5 votes vote down vote up
def test_read_version_1_0_bad_magic():
    for magic in bad_version_magic + malformed_magic:
        f = BytesIO(magic)
        yield raises(ValueError)(format.read_array), f 
Example 21
Project: vnpy_crypto   Author: birforce   File: test_format.py    MIT License 5 votes vote down vote up
def test_bad_magic_args():
    assert_raises(ValueError, format.magic, -1, 1)
    assert_raises(ValueError, format.magic, 256, 1)
    assert_raises(ValueError, format.magic, 1, -1)
    assert_raises(ValueError, format.magic, 1, 256) 
Example 22
Project: ble5-nrf52-mac   Author: tomasero   File: test_format.py    MIT License 5 votes vote down vote up
def test_read_magic_bad_magic():
    for magic in malformed_magic:
        f = BytesIO(magic)
        assert_raises(ValueError, format.read_array, f) 
Example 23
Project: ble5-nrf52-mac   Author: tomasero   File: test_format.py    MIT License 5 votes vote down vote up
def test_read_version_1_0_bad_magic():
    for magic in bad_version_magic + malformed_magic:
        f = BytesIO(magic)
        assert_raises(ValueError, format.read_array, f) 
Example 24
Project: ble5-nrf52-mac   Author: tomasero   File: test_format.py    MIT License 5 votes vote down vote up
def test_bad_magic_args():
    assert_raises(ValueError, format.magic, -1, 1)
    assert_raises(ValueError, format.magic, 256, 1)
    assert_raises(ValueError, format.magic, 1, -1)
    assert_raises(ValueError, format.magic, 1, 256) 
Example 25
Project: Computable   Author: ktraunmueller   File: test_format.py    MIT License 5 votes vote down vote up
def test_read_magic_bad_magic():
    for magic in malformed_magic:
        f = BytesIO(magic)
        yield raises(ValueError)(format.read_magic), f 
Example 26
Project: Computable   Author: ktraunmueller   File: test_format.py    MIT License 5 votes vote down vote up
def test_read_version_1_0_bad_magic():
    for magic in bad_version_magic + malformed_magic:
        f = BytesIO(magic)
        yield raises(ValueError)(format.read_array), f 
Example 27
Project: Computable   Author: ktraunmueller   File: test_format.py    MIT License 5 votes vote down vote up
def test_bad_magic_args():
    assert_raises(ValueError, format.magic, -1, 1)
    assert_raises(ValueError, format.magic, 256, 1)
    assert_raises(ValueError, format.magic, 1, -1)
    assert_raises(ValueError, format.magic, 1, 256) 
Example 28
Project: poker   Author: surgebiswas   File: test_format.py    MIT License 5 votes vote down vote up
def test_read_magic_bad_magic():
    for magic in malformed_magic:
        f = BytesIO(magic)
        yield raises(ValueError)(format.read_magic), f 
Example 29
Project: poker   Author: surgebiswas   File: test_format.py    MIT License 5 votes vote down vote up
def test_read_version_1_0_bad_magic():
    for magic in bad_version_magic + malformed_magic:
        f = BytesIO(magic)
        yield raises(ValueError)(format.read_array), f 
Example 30
Project: poker   Author: surgebiswas   File: test_format.py    MIT License 5 votes vote down vote up
def test_bad_magic_args():
    assert_raises(ValueError, format.magic, -1, 1)
    assert_raises(ValueError, format.magic, 256, 1)
    assert_raises(ValueError, format.magic, 1, -1)
    assert_raises(ValueError, format.magic, 1, 256) 
Example 31
Project: P3_image_processing   Author: latedude2   File: test_format.py    MIT License 5 votes vote down vote up
def test_read_magic_bad_magic():
    for magic in malformed_magic:
        f = BytesIO(magic)
        assert_raises(ValueError, format.read_array, f) 
Example 32
Project: P3_image_processing   Author: latedude2   File: test_format.py    MIT License 5 votes vote down vote up
def test_read_version_1_0_bad_magic():
    for magic in bad_version_magic + malformed_magic:
        f = BytesIO(magic)
        assert_raises(ValueError, format.read_array, f) 
Example 33
Project: P3_image_processing   Author: latedude2   File: test_format.py    MIT License 5 votes vote down vote up
def test_bad_magic_args():
    assert_raises(ValueError, format.magic, -1, 1)
    assert_raises(ValueError, format.magic, 256, 1)
    assert_raises(ValueError, format.magic, 1, -1)
    assert_raises(ValueError, format.magic, 1, 256) 
Example 34
Project: GraphicDesignPatternByPython   Author: Relph1119   File: test_format.py    MIT License 5 votes vote down vote up
def test_read_magic_bad_magic():
    for magic in malformed_magic:
        f = BytesIO(magic)
        assert_raises(ValueError, format.read_array, f) 
Example 35
Project: GraphicDesignPatternByPython   Author: Relph1119   File: test_format.py    MIT License 5 votes vote down vote up
def test_read_version_1_0_bad_magic():
    for magic in bad_version_magic + malformed_magic:
        f = BytesIO(magic)
        assert_raises(ValueError, format.read_array, f) 
Example 36
Project: GraphicDesignPatternByPython   Author: Relph1119   File: test_format.py    MIT License 5 votes vote down vote up
def test_bad_magic_args():
    assert_raises(ValueError, format.magic, -1, 1)
    assert_raises(ValueError, format.magic, 256, 1)
    assert_raises(ValueError, format.magic, 1, -1)
    assert_raises(ValueError, format.magic, 1, 256) 
Example 37
Project: 3dprinteros-client   Author: panasevychol   File: test_format.py    GNU Affero General Public License v3.0 5 votes vote down vote up
def test_read_magic_bad_magic():
    for magic in malformed_magic:
        f = BytesIO(magic)
        yield raises(ValueError)(format.read_magic), f 
Example 38
Project: 3dprinteros-client   Author: panasevychol   File: test_format.py    GNU Affero General Public License v3.0 5 votes vote down vote up
def test_read_version_1_0_bad_magic():
    for magic in bad_version_magic + malformed_magic:
        f = BytesIO(magic)
        yield raises(ValueError)(format.read_array), f 
Example 39
Project: 3dprinteros-client   Author: panasevychol   File: test_format.py    GNU Affero General Public License v3.0 5 votes vote down vote up
def test_bad_magic_args():
    assert_raises(ValueError, format.magic, -1, 1)
    assert_raises(ValueError, format.magic, 256, 1)
    assert_raises(ValueError, format.magic, 1, -1)
    assert_raises(ValueError, format.magic, 1, 256) 
Example 40
Project: 3dprinteros-client   Author: panasevychol   File: test_format.py    GNU Affero General Public License v3.0 5 votes vote down vote up
def test_read_magic_bad_magic():
    for magic in malformed_magic:
        f = BytesIO(magic)
        yield raises(ValueError)(format.read_magic), f 
Example 41
Project: 3dprinteros-client   Author: panasevychol   File: test_format.py    GNU Affero General Public License v3.0 5 votes vote down vote up
def test_read_version_1_0_bad_magic():
    for magic in bad_version_magic + malformed_magic:
        f = BytesIO(magic)
        yield raises(ValueError)(format.read_array), f 
Example 42
Project: predictive-maintenance-using-machine-learning   Author: awslabs   File: test_format.py    Apache License 2.0 5 votes vote down vote up
def test_read_magic_bad_magic():
    for magic in malformed_magic:
        f = BytesIO(magic)
        assert_raises(ValueError, format.read_array, f) 
Example 43
Project: predictive-maintenance-using-machine-learning   Author: awslabs   File: test_format.py    Apache License 2.0 5 votes vote down vote up
def test_read_version_1_0_bad_magic():
    for magic in bad_version_magic + malformed_magic:
        f = BytesIO(magic)
        assert_raises(ValueError, format.read_array, f) 
Example 44
Project: predictive-maintenance-using-machine-learning   Author: awslabs   File: test_format.py    Apache License 2.0 5 votes vote down vote up
def test_bad_magic_args():
    assert_raises(ValueError, format.magic, -1, 1)
    assert_raises(ValueError, format.magic, 256, 1)
    assert_raises(ValueError, format.magic, 1, -1)
    assert_raises(ValueError, format.magic, 1, 256) 
Example 45
Project: fund   Author: Frank-qlu   File: test_format.py    Apache License 2.0 5 votes vote down vote up
def test_read_magic_bad_magic():
    for magic in malformed_magic:
        f = BytesIO(magic)
        assert_raises(ValueError, format.read_array, f) 
Example 46
Project: fund   Author: Frank-qlu   File: test_format.py    Apache License 2.0 5 votes vote down vote up
def test_read_version_1_0_bad_magic():
    for magic in bad_version_magic + malformed_magic:
        f = BytesIO(magic)
        assert_raises(ValueError, format.read_array, f) 
Example 47
Project: fund   Author: Frank-qlu   File: test_format.py    Apache License 2.0 5 votes vote down vote up
def test_bad_magic_args():
    assert_raises(ValueError, format.magic, -1, 1)
    assert_raises(ValueError, format.magic, 256, 1)
    assert_raises(ValueError, format.magic, 1, -1)
    assert_raises(ValueError, format.magic, 1, 256) 
Example 48
Project: pySINDy   Author: luckystarufo   File: test_format.py    MIT License 5 votes vote down vote up
def test_read_magic_bad_magic():
    for magic in malformed_magic:
        f = BytesIO(magic)
        assert_raises(ValueError, format.read_array, f) 
Example 49
Project: pySINDy   Author: luckystarufo   File: test_format.py    MIT License 5 votes vote down vote up
def test_read_version_1_0_bad_magic():
    for magic in bad_version_magic + malformed_magic:
        f = BytesIO(magic)
        assert_raises(ValueError, format.read_array, f) 
Example 50
Project: pySINDy   Author: luckystarufo   File: test_format.py    MIT License 5 votes vote down vote up
def test_bad_magic_args():
    assert_raises(ValueError, format.magic, -1, 1)
    assert_raises(ValueError, format.magic, 256, 1)
    assert_raises(ValueError, format.magic, 1, -1)
    assert_raises(ValueError, format.magic, 1, 256) 
Example 51
Project: Programming-for-Non-Technical-Roles-   Author: PacktPublishing   File: test_format.py    MIT License 5 votes vote down vote up
def test_read_magic_bad_magic():
    for magic in malformed_magic:
        f = BytesIO(magic)
        yield raises(ValueError)(format.read_magic), f 
Example 52
Project: Programming-for-Non-Technical-Roles-   Author: PacktPublishing   File: test_format.py    MIT License 5 votes vote down vote up
def test_read_version_1_0_bad_magic():
    for magic in bad_version_magic + malformed_magic:
        f = BytesIO(magic)
        yield raises(ValueError)(format.read_array), f 
Example 53
Project: Programming-for-Non-Technical-Roles-   Author: PacktPublishing   File: test_format.py    MIT License 5 votes vote down vote up
def test_bad_magic_args():
    assert_raises(ValueError, format.magic, -1, 1)
    assert_raises(ValueError, format.magic, 256, 1)
    assert_raises(ValueError, format.magic, 1, -1)
    assert_raises(ValueError, format.magic, 1, 256) 
Example 54
Project: linear_neuron   Author: uglyboxer   File: test_format.py    MIT License 5 votes vote down vote up
def test_read_magic_bad_magic():
    for magic in malformed_magic:
        f = BytesIO(magic)
        yield raises(ValueError)(format.read_magic), f 
Example 55
Project: linear_neuron   Author: uglyboxer   File: test_format.py    MIT License 5 votes vote down vote up
def test_read_version_1_0_bad_magic():
    for magic in bad_version_magic + malformed_magic:
        f = BytesIO(magic)
        yield raises(ValueError)(format.read_array), f 
Example 56
Project: linear_neuron   Author: uglyboxer   File: test_format.py    MIT License 5 votes vote down vote up
def test_bad_magic_args():
    assert_raises(ValueError, format.magic, -1, 1)
    assert_raises(ValueError, format.magic, 256, 1)
    assert_raises(ValueError, format.magic, 1, -1)
    assert_raises(ValueError, format.magic, 1, 256) 
Example 57
Project: facethin   Author: ParkerGod   File: test_format.py    GNU General Public License v3.0 5 votes vote down vote up
def test_read_magic_bad_magic():
    for magic in malformed_magic:
        f = BytesIO(magic)
        assert_raises(ValueError, format.read_array, f) 
Example 58
Project: facethin   Author: ParkerGod   File: test_format.py    GNU General Public License v3.0 5 votes vote down vote up
def test_read_version_1_0_bad_magic():
    for magic in bad_version_magic + malformed_magic:
        f = BytesIO(magic)
        assert_raises(ValueError, format.read_array, f) 
Example 59
Project: facethin   Author: ParkerGod   File: test_format.py    GNU General Public License v3.0 5 votes vote down vote up
def test_bad_magic_args():
    assert_raises(ValueError, format.magic, -1, 1)
    assert_raises(ValueError, format.magic, 256, 1)
    assert_raises(ValueError, format.magic, 1, -1)
    assert_raises(ValueError, format.magic, 1, 256) 
Example 60
Project: islam-buddy   Author: hamir   File: test_format.py    MIT License 5 votes vote down vote up
def test_read_magic_bad_magic():
    for magic in malformed_magic:
        f = BytesIO(magic)
        yield raises(ValueError)(format.read_magic), f 
Example 61
Project: islam-buddy   Author: hamir   File: test_format.py    MIT License 5 votes vote down vote up
def test_read_version_1_0_bad_magic():
    for magic in bad_version_magic + malformed_magic:
        f = BytesIO(magic)
        yield raises(ValueError)(format.read_array), f 
Example 62
Project: islam-buddy   Author: hamir   File: test_format.py    MIT License 5 votes vote down vote up
def test_bad_magic_args():
    assert_raises(ValueError, format.magic, -1, 1)
    assert_raises(ValueError, format.magic, 256, 1)
    assert_raises(ValueError, format.magic, 1, -1)
    assert_raises(ValueError, format.magic, 1, 256) 
Example 63
Project: mxnet-lambda   Author: awslabs   File: test_format.py    Apache License 2.0 5 votes vote down vote up
def test_read_magic_bad_magic():
    for magic in malformed_magic:
        f = BytesIO(magic)
        yield raises(ValueError)(format.read_magic), f 
Example 64
Project: mxnet-lambda   Author: awslabs   File: test_format.py    Apache License 2.0 5 votes vote down vote up
def test_read_version_1_0_bad_magic():
    for magic in bad_version_magic + malformed_magic:
        f = BytesIO(magic)
        yield raises(ValueError)(format.read_array), f 
Example 65
Project: mxnet-lambda   Author: awslabs   File: test_format.py    Apache License 2.0 5 votes vote down vote up
def test_bad_magic_args():
    assert_raises(ValueError, format.magic, -1, 1)
    assert_raises(ValueError, format.magic, 256, 1)
    assert_raises(ValueError, format.magic, 1, -1)
    assert_raises(ValueError, format.magic, 1, 256) 
Example 66
Project: Deribit_funding_rate_indicator   Author: Dimasik007   File: test_format.py    MIT License 5 votes vote down vote up
def test_read_magic_bad_magic():
    for magic in malformed_magic:
        f = BytesIO(magic)
        assert_raises(ValueError, format.read_array, f) 
Example 67
Project: Deribit_funding_rate_indicator   Author: Dimasik007   File: test_format.py    MIT License 5 votes vote down vote up
def test_read_version_1_0_bad_magic():
    for magic in bad_version_magic + malformed_magic:
        f = BytesIO(magic)
        assert_raises(ValueError, format.read_array, f) 
Example 68
Project: Deribit_funding_rate_indicator   Author: Dimasik007   File: test_format.py    MIT License 5 votes vote down vote up
def test_bad_magic_args():
    assert_raises(ValueError, format.magic, -1, 1)
    assert_raises(ValueError, format.magic, 256, 1)
    assert_raises(ValueError, format.magic, 1, -1)
    assert_raises(ValueError, format.magic, 1, 256) 
Example 69
Project: psychrometric-chart-makeover   Author: buds-lab   File: test_format.py    MIT License 5 votes vote down vote up
def test_read_magic_bad_magic():
    for magic in malformed_magic:
        f = BytesIO(magic)
        assert_raises(ValueError, format.read_array, f) 
Example 70
Project: psychrometric-chart-makeover   Author: buds-lab   File: test_format.py    MIT License 5 votes vote down vote up
def test_read_version_1_0_bad_magic():
    for magic in bad_version_magic + malformed_magic:
        f = BytesIO(magic)
        assert_raises(ValueError, format.read_array, f) 
Example 71
Project: psychrometric-chart-makeover   Author: buds-lab   File: test_format.py    MIT License 5 votes vote down vote up
def test_bad_magic_args():
    assert_raises(ValueError, format.magic, -1, 1)
    assert_raises(ValueError, format.magic, 256, 1)
    assert_raises(ValueError, format.magic, 1, -1)
    assert_raises(ValueError, format.magic, 1, 256) 
Example 72
Project: wine-ml-on-aws-lambda   Author: pierreant   File: test_format.py    Apache License 2.0 5 votes vote down vote up
def test_read_magic_bad_magic():
    for magic in malformed_magic:
        f = BytesIO(magic)
        yield raises(ValueError)(format.read_magic), f 
Example 73
Project: wine-ml-on-aws-lambda   Author: pierreant   File: test_format.py    Apache License 2.0 5 votes vote down vote up
def test_read_version_1_0_bad_magic():
    for magic in bad_version_magic + malformed_magic:
        f = BytesIO(magic)
        yield raises(ValueError)(format.read_array), f 
Example 74
Project: wine-ml-on-aws-lambda   Author: pierreant   File: test_format.py    Apache License 2.0 5 votes vote down vote up
def test_bad_magic_args():
    assert_raises(ValueError, format.magic, -1, 1)
    assert_raises(ValueError, format.magic, 256, 1)
    assert_raises(ValueError, format.magic, 1, -1)
    assert_raises(ValueError, format.magic, 1, 256) 
Example 75
Project: linux-cross-gcc   Author: nmercier   File: test_format.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def test_read_magic_bad_magic():
    for magic in malformed_magic:
        f = BytesIO(magic)
        yield raises(ValueError)(format.read_magic), f 
Example 76
Project: linux-cross-gcc   Author: nmercier   File: test_format.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def test_read_version_1_0_bad_magic():
    for magic in bad_version_magic + malformed_magic:
        f = BytesIO(magic)
        yield raises(ValueError)(format.read_array), f 
Example 77
Project: linux-cross-gcc   Author: nmercier   File: test_format.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def test_bad_magic_args():
    assert_raises(ValueError, format.magic, -1, 1)
    assert_raises(ValueError, format.magic, 256, 1)
    assert_raises(ValueError, format.magic, 1, -1)
    assert_raises(ValueError, format.magic, 1, 256) 
Example 78
Project: SignLanguage_ML   Author: mareep-raljodid   File: test_format.py    MIT License 5 votes vote down vote up
def test_read_magic_bad_magic():
    for magic in malformed_magic:
        f = BytesIO(magic)
        assert_raises(ValueError, format.read_array, f) 
Example 79
Project: SignLanguage_ML   Author: mareep-raljodid   File: test_format.py    MIT License 5 votes vote down vote up
def test_read_version_1_0_bad_magic():
    for magic in bad_version_magic + malformed_magic:
        f = BytesIO(magic)
        assert_raises(ValueError, format.read_array, f) 
Example 80
Project: SignLanguage_ML   Author: mareep-raljodid   File: test_format.py    MIT License 5 votes vote down vote up
def test_bad_magic_args():
    assert_raises(ValueError, format.magic, -1, 1)
    assert_raises(ValueError, format.magic, 256, 1)
    assert_raises(ValueError, format.magic, 1, -1)
    assert_raises(ValueError, format.magic, 1, 256)