def check_unique(file_unique_id: str, expected_file_unique_type: FileUniqueType): decoded = FileUniqueId.decode(file_unique_id) assert decoded.file_unique_type == expected_file_unique_type assert decoded.encode() == file_unique_id
def test_stringify_file_unique_id(): file_unique_id = "AgADBAADgaS5SQ" string = "{'file_unique_type': <FileUniqueType.DOCUMENT: 2>, 'media_id': 5312458109417947140}" assert str(FileUniqueId.decode(file_unique_id)) == string