コード例 #1
0
def test_feature_model():
    f = d.feature(1, var_mode=d.Feature.Modality.BYTES)
    assert f is not None
    assert f.mode == d.Feature.Modality.BYTES
コード例 #2
0
def test_feature_type():
    f = d.feature(1, var_type=d.Feature.Variable.ORDINAL)
    assert f is not None
    assert f.type == d.Feature.Variable.ORDINAL
コード例 #3
0
def test_feature_list():
    f = d.feature(['asdf', 'asdf'])
    assert f is not None
    assert d.value(f.value) == ['asdf', 'asdf']
コード例 #4
0
def test_feature_struct():
    my_dict = {'asdf': 1, 'foo': 'bar'}
    f = d.feature(my_dict)
    assert f is not None
    assert d.value(f.value) == my_dict
コード例 #5
0
def test_feature():
    f = d.feature('asdf')
    assert f is not None
    assert d.value(f.value) == 'asdf'
    assert f.value.HasField("list_value") is False