Пример #1
0
    def test_check_org_expired(self, confirm):
        config = CliConfig()
        config.keychain = mock.Mock()
        org_config = OrgConfig(
            {
                "scratch": True,
                "date_created": date.today() - timedelta(days=2),
                "expired": True,
            },
            "test",
        )
        confirm.return_value = True

        config.check_org_expired("test", org_config)
        config.keychain.create_scratch_org.assert_called_once()
Пример #2
0
    def test_check_org_expired_decline(self, confirm):
        config = CliConfig()
        config.keychain = mock.Mock()
        org_config = OrgConfig(
            {
                "scratch": True,
                "date_created": date.today() - timedelta(days=2),
                "expired": True,
            },
            "test",
        )
        confirm.return_value = False

        with self.assertRaises(click.ClickException):
            config.check_org_expired("test", org_config)