INNER CODE UNIT · Python

test_missing_pubspec_version_fails

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

    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)],
                capture_output=True, text=True,
            )
        self.assertEqual(result.returncode, 0, result.stderr)
        self.assertEqual(result.stdout.strip(), '1.6.3')

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…