Пример #1
0
def test_constant_call_with_some_rows():
    features = make_features_with_no_columns(num_rows=3)
    encoding = ConstantStringEncoding(constant='abc')

    values = encoding(features)

    np.testing.assert_equal(values, 'abc')
Пример #2
0
def test_validate_from_non_format_string():
    argument = 'abc'
    expected = ConstantStringEncoding(constant=argument)

    actual = validate_string_encoding(argument)

    assert actual == expected
Пример #3
0
def test_validate_from_constant_dict():
    constant = 'test'
    argument = {'constant': constant}
    expected = ConstantStringEncoding(constant=constant)

    actual = validate_string_encoding(argument)

    assert actual == expected