Esempio n. 1
0
def test_get_type_fail():
    """
    Test that type correctly errors when an invalid type is passed.

    :return:
    """
    source = deque('abc')
    eg = EveGenie(data=simple_test_data)
    with pytest.raises(TypeError):
        eg.get_type(source)
Esempio n. 2
0
def test_get_type_fail():
    """
    Test that type correctly errors when an invalid type is passed.

    :return:
    """
    source = deque('abc')
    eg = EveGenie(data=simple_test_data)
    with pytest.raises(TypeError):
        eg.get_type(source)
Esempio n. 3
0
def test_get_type_float():
    """
    Test that a float maps to an eve 'float'

    :return:
    """
    source = 4.2
    eg = EveGenie(data=simple_test_data)
    assert (eg.get_type(source) == 'float')
Esempio n. 4
0
def test_get_type_bool():
    """
    Test that a bool maps to an eve 'boolean'

    :return:
    """
    source = True
    eg = EveGenie(data=simple_test_data)
    assert (eg.get_type(source) == 'boolean')
Esempio n. 5
0
def test_get_type_int():
    """
    Test that an int maps to an eve 'integer'

    :return:
    """
    source = 42
    eg = EveGenie(data=simple_test_data)
    assert (eg.get_type(source) == 'integer')
Esempio n. 6
0
def test_get_type_int():
    """
    Test that an int maps to an eve 'integer'

    :return:
    """
    source = 42
    eg = EveGenie(data=simple_test_data)
    assert(eg.get_type(source) == 'integer')
Esempio n. 7
0
def test_get_type_str():
    """
    Test that a str maps to an eve 'string'

    :return:
    """
    source = 'snowman'
    eg = EveGenie(data=simple_test_data)
    assert (eg.get_type(source) == 'string')
Esempio n. 8
0
def test_get_type_list():
    """
    Test that a list maps to an eve 'list'

    :return:
    """
    source = [1, 2, 3]
    eg = EveGenie(data=simple_test_data)
    assert (eg.get_type(source) == 'list')
Esempio n. 9
0
def test_get_type_intrange():
    """
    Test that an integer range string maps to an eve 'integer'

    :return:
    """
    source = "1-10"
    eg = EveGenie(data=simple_test_data)
    assert (eg.get_type(source) == 'integer')
Esempio n. 10
0
def test_get_type_intrange():
    """
    Test that an integer range string maps to an eve 'integer'

    :return:
    """
    source = "1-10"
    eg = EveGenie(data=simple_test_data)
    assert(eg.get_type(source) == 'integer')
Esempio n. 11
0
def test_get_type_floatrange():
    """
    Test that a float range string maps to an eve 'float'

    :return:
    """
    source = "0.0-1.0"
    eg = EveGenie(data=simple_test_data)
    assert(eg.get_type(source) == 'float')
Esempio n. 12
0
def test_get_type_list():
    """
    Test that a list maps to an eve 'list'

    :return:
    """
    source = [1, 2, 3]
    eg = EveGenie(data=simple_test_data)
    assert(eg.get_type(source) == 'list')
Esempio n. 13
0
def test_get_type_objectid():
    """
    Test that an objectid string maps to an eve 'objectid'

    :return:
    """
    source = 'objectid:test'
    eg = EveGenie(data=simple_test_data)
    assert(eg.get_type(source) == 'objectid')
Esempio n. 14
0
def test_get_type_ordereddict():
    """
    Test that a OrderedDict maps to an eve 'dict'

    :return:
    """
    source = OrderedDict([('a','b')])
    eg = EveGenie(data=simple_test_data)
    assert(eg.get_type(source) == 'dict')
Esempio n. 15
0
def test_get_type_dict():
    """
    Test that a dict maps to an eve 'dict'

    :return:
    """
    source = {'a':'b'}
    eg = EveGenie(data=simple_test_data)
    assert(eg.get_type(source) == 'dict')
Esempio n. 16
0
def test_get_type_float():
    """
    Test that a float maps to an eve 'float'

    :return:
    """
    source = 4.2
    eg = EveGenie(data=simple_test_data)
    assert(eg.get_type(source) == 'float')
Esempio n. 17
0
def test_get_type_dict():
    """
    Test that a dict maps to an eve 'dict'

    :return:
    """
    source = {'a': 'b'}
    eg = EveGenie(data=simple_test_data)
    assert (eg.get_type(source) == 'dict')
Esempio n. 18
0
def test_get_type_null():
    """
    Test that a None maps to an eve 'null'.

    :return:
    """
    source = None
    eg = EveGenie(data=simple_test_data)
    assert(eg.get_type(source) == 'null')
Esempio n. 19
0
def test_get_type_ordereddict():
    """
    Test that a OrderedDict maps to an eve 'dict'

    :return:
    """
    source = OrderedDict([('a', 'b')])
    eg = EveGenie(data=simple_test_data)
    assert (eg.get_type(source) == 'dict')
Esempio n. 20
0
def test_get_type_null():
    """
    Test that a None maps to an eve 'null'.

    :return:
    """
    source = None
    eg = EveGenie(data=simple_test_data)
    assert (eg.get_type(source) == 'null')
Esempio n. 21
0
def test_get_type_objectid():
    """
    Test that an objectid string maps to an eve 'objectid'

    :return:
    """
    source = 'objectid:test'
    eg = EveGenie(data=simple_test_data)
    assert (eg.get_type(source) == 'objectid')
Esempio n. 22
0
def test_get_type_str():
    """
    Test that a str maps to an eve 'string'

    :return:
    """
    source = 'snowman'
    eg = EveGenie(data=simple_test_data)
    assert(eg.get_type(source) == 'string')
Esempio n. 23
0
def test_get_type_floatrange():
    """
    Test that a float range string maps to an eve 'float'

    :return:
    """
    source = "0.0-1.0"
    eg = EveGenie(data=simple_test_data)
    assert (eg.get_type(source) == 'float')
Esempio n. 24
0
def test_get_type_bool():
    """
    Test that a bool maps to an eve 'boolean'

    :return:
    """
    source = True
    eg = EveGenie(data=simple_test_data)
    assert(eg.get_type(source) == 'boolean')
Esempio n. 25
0
def test_get_type_unicode():
    """
    Test that a unicode string maps to an eve 'string'

    :return:
    """
    source = '☃'
    eg = EveGenie(data=simple_test_data)
    assert (eg.get_type(source) == 'string')
Esempio n. 26
0
def test_get_type_unicode():
    """
    Test that a unicode string maps to an eve 'string'

    :return:
    """
    source = '☃'
    eg = EveGenie(data=simple_test_data)
    assert(eg.get_type(source) == 'string')