0
  /   ˆ{‹„„-i[D<†ªoZƒ›Ù«Â523_‘I|¥‰ÓMdœv ©ƒ†ü+=ÂÁ     ‹      Õ•QoÚ0Çßû)<?ì.�®ÔñÔ¤¡Q@”iš¦irbC¬&6²”}ú9$V•­Ó6­{òùò÷Ýý.‰�<‹Ç½Ù‡I½™]ÑäÝëá ‡pà}»ÏâêÁy3ú#ŒpæÜ²°Ùlš›vS›Ì¦�¹"?ëŒL]“;Žé)}ô‘L0îWDœt¹ ÅÅÒszå¬äÂŸÛZàb-SaKÛ‰
Qh³­—6(ÍEPï:°«¤Ò¨‚ú4Pç!‰æÛ2}ø§Sùˆ;–ì2–¦¡ÄehÍr¹Pvz‰)‘ÅY“Fdª•…$gê¶¹�sŒXî"üqÐò:pYyš†2#æ~Õ‹F—ã(ÆtÄ
A€=¬¹öš+L‡Ì:Th.çRð“â›J|#¿œWšXØÔÈ¥“Z¤à�QS�Û%ó¬/<AfŽU•„ÿ¬,ý®“«i4‹Óª%¼q¨î7^¦f„r(–F¤Î;kª*Ås•Øåå~‹êš�\dS„èAå/€ÎuÎ…9F=¹ÇÂtoWz¯´VÐºh„a#ì ðe7¸@èi0¹fÇP[O…a¥n•Þ¨cÿ=ÿâ3[ùPF'âÍÁõ¬V€Za7ObùÛôí?Àº‡ô¿â¬ÄÚÿÖ˜Vëßxäíõ\ °@ªù÷,‰b       ˆÀ¿Ã597¾ÂÁ U    ‹      Õ–moÚ0Çß÷Sx~±wp<´]Kƒ§Ž •¢LÓ4M•‰±šØ‘m`ôÓÏÁi›NE£Z[ÑWçKþ¹»Ÿs~>„ÃÎäÇ¨‹¾N.ûhôíK¿×A¸ð½Ù'¡qX­ÕºŒplmÖX­VÕU³ªô&cˆmš‚±ZD¶Ê,Ãä ÈŸ‘Äœ2gQ`…M8éIÆ#5C ÖÆÝwkŒ/EÄM>¶<…”§J¯Ó©¯ÞQí‘{r€�ìrA‘,˜*¶Îk¨¿J>vD§›´ùP“ÀÆhI1—mlU†I Ò92:jc‘’¦	•7Õ¹˜aDÛÆ?{�á/§ç_“€¢XóYî´gÃvˆÉ€¦< ú´æÒiÎ1éScQª˜˜	Î¶Š¯¼øJÜnzMÈM¤Ef…’RpˆeÔH%&£ŽõÈÄº¬òö¯Ù Ñ£É��»ƒIØû)ayˆ‡êþûïa2¢šK‹B¡ydÝ«‚Í'ú(§&;»sQQ¹óØb‚P=©|îL%Œë2ð6Ô»z½-WùWY�Zã¸R¯Wê§¨þ©U;Fèë_È©V²àºáI %!9&Þî Ð¨¡F³utºÀí?o�Åksí{“’ó^QD¾$›ñ¾€ì¾(2µâÚ-
o_¢þ7^ÚmGËüÀÀä~¸/¿áÆRë6f_Êß½‹ÌbZá~ü·Ø_º³o_à�û(Ä®o•ä“’óú=µãŠÛ] ›»d þ>û”ÐûÀ2    6   ˆl—ß=¿Jõ4Ÿº‚ œP.\—qLZ7ÿ�þB g Ùl!x` ?ŸÅƒh¹ÄÃÂ      MODALIAS=acpi:LNXCPU:
  6   	ˆl–Ãa¾”Ò~êqA3p ¸ÛŠbÑ¿�þB gr2ë±„¬»üÿÆƒh¹ÅÄÃ      	unsupported
     ˆÂÁÅ523ÀÄÃ     ‹      Õ•QoÚ0Çßû)<?ì.Ö©ÔñÔ¤¡Q@”iš¦irbC¬&6²Œ}ú9$V•­Ó6­{òùò÷Ýý.‰�<‹Ç½Ù‡I½™]ÑäÝëá ‡pà}»ÏâêA§„ ýF8snÙØl6ÍM»©ÍfSÈ\‘wÀ:#S×äŽczFJ=C$Œû'].è@qñé9½rVráÏm-p±–©°¥íD…(´ÙÖK”æ"¨wíØURéTA}¨ó�Dóm™>üÓ©|ÄKvKÓPâ2´f¹\¨;½Ä”Èb�¬I#2ÕÊB’3uÛ\È9F,wþ8è�?y¸¬<M	C™ó¿êE£Ëqc:b… ÀÖ\{Í¦Cf*4—s)øIñM%¾‘_OŒ+M,ljäÒI­RðˆÇ¨©Îí’yÖž 3ÇªJÂÖ–~×ŒÉÕ´?šÅƒiÕ^†8T÷/Ó	3B9K#Rç�5U•â¹Jìòr¿EuÍF.2‡)Bô ò@ç:çÂ£ž‚Ücaº·Ž+½WZ+h�7Â°^ ðe78Gèi0¹fÇP[O…a¥n•Þ¨cÿ=ÿâ3[ùPF'âŽæàzV+@­°„'±ümúö`ÝCú_qVbíkL«õï<òöƒz.Ø Õüûs–‘Db    6   ˆl–Ãa¾”Ò~êqA3p ¸Û*bÑ¿�þB gr2ëm¾ÓâþÇƒh¹ÆÅÄ      unsupported
  A   ˆl–äY>”ÊeJeA3p\eÅ1hß�þc#+7(Ÿ…eé ?ŸÈƒdÇ_ŠI|¥�+Wé3ž¯ÇÆ Ã    # test_credentials.py -- tests for credentials.py

# Copyright (C) 2022 Daniele TrifirÃ² <daniele@iterative.ai>
#
# Dulwich is dual-licensed under the Apache License, Version 2.0 and the GNU
# General Public License as public by the Free Software Foundation; version 2.0
# or (at your option) any later version. You can redistribute it and/or
# modify it under the terms of either of these two licenses.
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# You should have received a copy of the licenses; if not, see
# <http://www.gnu.org/licenses/> for a copy of the GNU General Public License
# and <http://www.apache.org/licenses/LICENSE-2.0> for a copy of the Apache
# License, Version 2.0.
#

from urllib.parse import urlparse

from dulwich.config import ConfigDict
from dulwich.credentials import (
    match_partial_url,
    match_urls,
    urlmatch_credential_sections,
)
from dulwich.tests import TestCase


class TestCredentialHelpersUtils(TestCase):

    def test_match_urls(self):
        url = urlparse("https://github.com/jelmer/dulwich/")
        url_1 = urlparse("https://github.com/jelmer/dulwich")
        url_2 = urlparse("https://github.com/jelmer")
        url_3 = urlparse("https://github.com")
        self.assertTrue(match_urls(url, url_1))
        self.assertTrue(match_urls(url, url_2))
        self.assertTrue(match_urls(url, url_3))

        non_matching = urlparse("https://git.sr.ht/")
        self.assertFalse(match_urls(url, non_matching))

    def test_match_partial_url(self):
        url = urlparse("https://github.com/jelmer/dulwich/")
        self.assertTrue(match_partial_url(url, "github.com"))
        self.assertFalse(match_partial_url(url, "github.com/jelmer/"))
    