Exemple #1
0
def test_text_input_with_illegal_dim():
    x = common.generate_data(shape=(32, ))
    input_node = node.TextInput()
    with pytest.raises(ValueError) as info:
        input_node.fit(x)
        x = input_node.transform(x)
    assert 'Expect the data to TextInput to have 1' in str(info.value)
Exemple #2
0
def test_text_string():
    x = np.array([1, 2])
    input_node = node.TextInput()
    with pytest.raises(TypeError) as info:
        input_node.fit(x)
        x = input_node.transform(x)
    assert 'Expect the data to TextInput to be strings' in str(info.value)
Exemple #3
0
def test_text_input_type_error():
    x = 'unknown'
    input_node = node.TextInput()
    with pytest.raises(TypeError) as info:
        input_node.fit(x)
        x = input_node.transform(x)
    assert 'Expect the data to TextInput to be numpy' in str(info.value)
Exemple #4
0
 def __init__(self, outputs, **kwargs):
     super().__init__(inputs=node.TextInput(), outputs=outputs, **kwargs)