def test_str_value(self): tag = Tag(tag="tg", type="A", value="P") actual = str(tag) expected = "tg:A:P" assert actual == expected
def test_float_value(self): tag = Tag(tag="de", type="f", value=0.5) actual = str(tag) expected = "de:f:0.5" assert actual == expected
def test_int_value(self): tag = Tag(tag="NM", type="i", value=50) actual = str(tag) expected = "NM:i:50" assert actual == expected
def test_tag_with_int_value_parsed(self): tag = "NM" tag_type = "i" value = 50 string = ":".join([tag, tag_type, str(value)]) actual = Tag.from_str(string) expected = Tag(tag, tag_type, value) assert actual == expected
def test_tag_with_non_letter_char_value_parsed(self): tag = "tg" tag_type = "A" value = "*" string = ":".join([tag, tag_type, value]) actual = Tag.from_str(string) expected = Tag(tag, tag_type, value) assert actual == expected
def test_tag_with_string_value_parsed(self): tag = "cg" tag_type = "Z" value = "97M1I13M" string = ":".join([tag, tag_type, value]) actual = Tag.from_str(string) expected = Tag(tag, tag_type, value) assert actual == expected
def test_tag_with_inf_float_value_parsed(self): tag = "de" tag_type = "f" value = "inf" string = ":".join([tag, tag_type, str(value)]) actual = Tag.from_str(string) expected = Tag(tag, tag_type, float(value)) assert actual == expected