def test_extract_msg_str_to_str(): msg = populate_instance(r'forty two', str()) data = extract_values(msg) assert isinstance(data, str) assert data == r'forty two'
def test_extract_msg_str_to_unicode(): msg = populate_instance(r'forty two', unicode()) data = extract_values(msg) assert isinstance(data, unicode) assert data == u'forty two'
def test_extract_msg_bytes_to_bytes(): msg = populate_instance(b'forty two', bytes()) data = extract_values(msg) assert isinstance(data, bytes) assert data == b'forty two'
def test_extract_msg_float(): msg = populate_instance(3.1415, float()) data = extract_values(msg) assert isinstance(data, float) assert data == 3.1415
def test_extract_msg_int_to_float(): msg = populate_instance(42, float()) data = extract_values(msg) assert isinstance(data, float) assert data == 42.0
def test_extract_msg_bool_false(): msg = populate_instance(False, bool()) data = extract_values(msg) assert isinstance(data, bool) assert not data
def test_extract_msg_bool_true(): msg = populate_instance(True, bool()) data = extract_values(msg) assert isinstance(data, bool) assert data