Example #1
0
def application_version(context, excel_path, signature, dry_run, skip_missing):
    """Import new application versions to status-db"""

    if not signature:
        signature = getpass.getuser()

    import_application_versions(context.obj["status"], excel_path, signature, dry_run, skip_missing)
Example #2
0
def application_version(context: CGConfig, excel_path: str, signature: str,
                        dry_run: bool, skip_missing: bool):
    """Import new application versions to status-db"""
    status_db: Store = context.status_db
    if not signature:
        signature = getpass.getuser()

    import_application_versions(
        store=status_db,
        excel_path=excel_path,
        sign=signature,
        dry_run=dry_run,
        skip_missing=skip_missing,
    )
Example #3
0
def test_application_version_dry_run(application_versions_file, store: Store):
    # GIVEN a store with applications
    # and an excel file with prices for those applications
    add_applications(store, application_versions_file)
    sign = "TestSign"

    # WHEN calling import_application_version as dry run
    import_application_versions(store,
                                application_versions_file,
                                sign,
                                dry_run=True,
                                skip_missing=False)

    # THEN versions should not have been created in the store
    assert not all_versions_exists_in_store(store, application_versions_file)
Example #4
0
def test_application_version_dry_run(
    applications_store: Store, application_versions_file: str, store_checkers: StoreCheckers
):
    # GIVEN a store with applications
    # and an excel file with prices for those applications
    sign = "TestSign"

    # WHEN calling import_application_version as dry run
    import_application_versions(
        store=applications_store,
        excel_path=application_versions_file,
        sign=sign,
        dry_run=True,
        skip_missing=False,
    )

    # THEN versions should not have been created in the store
    assert not store_checkers.all_versions_exist_in_store(
        store=applications_store, excel_path=application_versions_file
    )