File: test_image_api.py

package info (click to toggle)
keras-preprocessing 1.1.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 400 kB
  • sloc: python: 4,161; makefile: 11; sh: 10
file content (37 lines) | stat: -rw-r--r-- 942 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
from keras_preprocessing import image


def test_api_classes():
    expected_exposed_classes = [
        'DataFrameIterator',
        'DirectoryIterator',
        'ImageDataGenerator',
        'Iterator',
        'NumpyArrayIterator',
    ]
    for _class in expected_exposed_classes:
        assert hasattr(image, _class)


def test_api_functions():
    expected_exposed_functions = [
        'flip_axis',
        'random_rotation',
        'random_shift',
        'random_shear',
        'random_zoom',
        'apply_channel_shift',
        'random_channel_shift',
        'apply_brightness_shift',
        'random_brightness',
        'transform_matrix_offset_center',
        'apply_affine_transform',
        'validate_filename',
        'save_img',
        'load_img',
        'list_pictures',
        'array_to_img',
        'img_to_array'
    ]
    for function in expected_exposed_functions:
        assert hasattr(image, function)