Welcome To Our Shell

Mister Spy & Souheyl Bypass Shell

Current Path : /usr/local/lib/python3.8/dist-packages/qrcode/tests/

Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
Upload File :
Current File : //usr/local/lib/python3.8/dist-packages/qrcode/tests/test_release.py

import re
import builtins
import datetime
import unittest
from unittest import mock

from qrcode.release import update_manpage

OPEN = f"{builtins.__name__}.open"
DATA = 'test\n.TH "date" "version" "description"\nthis'


class UpdateManpageTests(unittest.TestCase):
    @mock.patch(OPEN, new_callable=mock.mock_open, read_data=".TH invalid")
    def test_invalid_data(self, mock_file):
        update_manpage({"name": "qrcode", "new_version": "1.23"})
        mock_file.assert_called()
        mock_file().write.assert_not_called()

    @mock.patch(OPEN, new_callable=mock.mock_open, read_data=DATA)
    def test_not_qrcode(self, mock_file):
        update_manpage({"name": "not-qrcode"})
        mock_file.assert_not_called()

    @mock.patch(OPEN, new_callable=mock.mock_open, read_data=DATA)
    def test_no_change(self, mock_file):
        update_manpage({"name": "qrcode", "new_version": "version"})
        mock_file.assert_called()
        mock_file().write.assert_not_called()

    @mock.patch(OPEN, new_callable=mock.mock_open, read_data=DATA)
    def test_change(self, mock_file):
        update_manpage({"name": "qrcode", "new_version": "3.11"})
        expected = re.split(r"([^\n]*(?:\n|$))", DATA)[1::2]
        expected[1] = (
            expected[1]
            .replace("version", "3.11")
            .replace("date", datetime.datetime.now().strftime("%-d %b %Y"))
        )
        mock_file().write.has_calls([mock.call(line) for line in expected])

bypass 1.0, Devloped By El Moujahidin (the source has been moved and devloped)
Email: contact@elmoujehidin.net bypass 1.0, Devloped By El Moujahidin (the source has been moved and devloped) Email: contact@elmoujehidin.net