def test_update_url_query(self):
    self.assertEqual(parse_qs(update_url_query('http://example.com/path', {'quality': ['HD'], 'format': ['mp4']})), parse_qs('http://example.com/path?quality=HD&format=mp4'))
    self.assertEqual(parse_qs(update_url_query('http://example.com/path', {'system': ['LINUX', 'WINDOWS']})), parse_qs('http://example.com/path?system=LINUX&system=WINDOWS'))
    self.assertEqual(parse_qs(update_url_query('http://example.com/path', {'fields': 'id,formats,subtitles'})), parse_qs('http://example.com/path?fields=id,formats,subtitles'))
    self.assertEqual(parse_qs(update_url_query('http://example.com/path', {'fields': ('id,formats,subtitles', 'thumbnails')})), parse_qs('http://example.com/path?fields=id,formats,subtitles&fields=thumbnails'))
    self.assertEqual(parse_qs(update_url_query('http://example.com/path?manifest=f4m', {'manifest': []})), parse_qs('http://example.com/path'))
    self.assertEqual(parse_qs(update_url_query('http://example.com/path?system=LINUX&system=WINDOWS', {'system': 'LINUX'})), parse_qs('http://example.com/path?system=LINUX'))
    self.assertEqual(parse_qs(update_url_query('http://example.com/path', {'fields': b'id,formats,subtitles'})), parse_qs('http://example.com/path?fields=id,formats,subtitles'))
    self.assertEqual(parse_qs(update_url_query('http://example.com/path', {'width': 1080, 'height': 720})), parse_qs('http://example.com/path?width=1080&height=720'))
    self.assertEqual(parse_qs(update_url_query('http://example.com/path', {'bitrate': 5020.43})), parse_qs('http://example.com/path?bitrate=5020.43'))
    self.assertEqual(parse_qs(update_url_query('http://example.com/path', {'test': '第二行тест'})), parse_qs('http://example.com/path?test=%E7%AC%AC%E4%BA%8C%E8%A1%8C%D1%82%D0%B5%D1%81%D1%82'))
def test_update_url_query(self):
    self.assertEqual(parse_qs(update_url_query('http://example.com/path', {'quality': ['HD'], 'format': ['mp4']})), parse_qs('http://example.com/path?quality=HD&format=mp4'))
    self.assertEqual(parse_qs(update_url_query('http://example.com/path', {'system': ['LINUX', 'WINDOWS']})), parse_qs('http://example.com/path?system=LINUX&system=WINDOWS'))
    self.assertEqual(parse_qs(update_url_query('http://example.com/path', {'fields': 'id,formats,subtitles'})), parse_qs('http://example.com/path?fields=id,formats,subtitles'))
    self.assertEqual(parse_qs(update_url_query('http://example.com/path', {'fields': ('id,formats,subtitles', 'thumbnails')})), parse_qs('http://example.com/path?fields=id,formats,subtitles&fields=thumbnails'))
    self.assertEqual(parse_qs(update_url_query('http://example.com/path?manifest=f4m', {'manifest': []})), parse_qs('http://example.com/path'))
    self.assertEqual(parse_qs(update_url_query('http://example.com/path?system=LINUX&system=WINDOWS', {'system': 'LINUX'})), parse_qs('http://example.com/path?system=LINUX'))
    self.assertEqual(parse_qs(update_url_query('http://example.com/path', {'fields': b'id,formats,subtitles'})), parse_qs('http://example.com/path?fields=id,formats,subtitles'))
    self.assertEqual(parse_qs(update_url_query('http://example.com/path', {'width': 1080, 'height': 720})), parse_qs('http://example.com/path?width=1080&height=720'))
    self.assertEqual(parse_qs(update_url_query('http://example.com/path', {'bitrate': 5020.43})), parse_qs('http://example.com/path?bitrate=5020.43'))
    self.assertEqual(parse_qs(update_url_query('http://example.com/path', {'test': '第二行тест'})), parse_qs('http://example.com/path?test=%E7%AC%AC%E4%BA%8C%E8%A1%8C%D1%82%D0%B5%D1%81%D1%82'))