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)
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)
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)
def __init__(self, outputs, **kwargs): super().__init__(inputs=node.TextInput(), outputs=outputs, **kwargs)