INNER CODE UNIT · Python

test_invalid_tags_fail

sun-jiao/flut-renamer · packaging/test_release_version.py:21

    def test_invalid_tags_fail(self):
        for tag in ['1.6.3', 'v1.6', 'v1x6x3', 'v1.6.3-', 'v1.6.3-test..1',
                    'v1.6.3-test/1', 'v1.6.3-test\n', 'v1.6.3-"']:
            with self.subTest(tag=tag), self.assertRaises(ValueError):
                parse_tag(tag)

    def test_missing_pubspec_version_fails(self):
        with self.assertRaisesRegex(ValueError, 'Cannot read'):
            validate_version('v1.6.3', 'name: app\n')

    def test_cli_for_reported_release_tag(self):
        root = Path(__file__).resolve().parent.parent
        with tempfile.TemporaryDirectory() as directory:
            pubspec = Path(directory) / 'pubspec.yaml'
            pubspec.write_text('name: app\nversion: 1.6.3+18\n')
            result = subprocess.run(
                [sys.executable, str(root / 'packaging/release_version.py'),
                 '--tag', 'v1.6.3-new-packages-test', '--pubspec', str(pubspec)],

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…