예제 #1
0
def application(context, excel_path, signature, sheet_name, dry_run):
    """Import new applications to status-db"""

    if not signature:
        signature = getpass.getuser()

    import_applications(context.obj["status"], excel_path, signature, dry_run, sheet_name)
예제 #2
0
def test_application_dry_run(applications_file: str, store: Store, store_checkers: StoreCheckers):
    # GIVEN a store and an excel file with applications
    sign = "TestSign"

    # WHEN calling import_applications as dry run
    import_applications(store=store, excel_path=applications_file, sign=sign, dry_run=True)

    # THEN applications should not have been created in the store
    assert not store_checkers.all_applications_exists(store, applications_file)
예제 #3
0
def test_application_dry_run(applications_file, store: Store):
    # GIVEN a store and an excel file with applications
    sign = "TestSign"

    # WHEN calling import_applications as dry run
    import_applications(store, applications_file, sign, dry_run=True)

    # THEN applications should not have been created in the store
    assert not all_applications_exists(store, applications_file)
예제 #4
0
def test_application(store: Store, applications_file: str, store_checkers: StoreCheckers):
    # GIVEN an excel file with applications
    assert store_checkers.all_applications_exists(store, applications_file) is False
    # GIVEN a store without the applications
    sign = "TestSign"

    # WHEN calling import_applications
    import_applications(store=store, excel_path=applications_file, sign=sign, dry_run=False)

    # THEN applications should have been created in the store
    assert store_checkers.all_applications_exists(store, applications_file)
예제 #5
0
def test_application_sheet_name(applications_file, store: Store):
    # GIVEN a store and an excel file with applications
    sign = "TestSign"

    # WHEN calling import_applications
    import_applications(store,
                        applications_file,
                        sign,
                        dry_run=False,
                        sheet_name="application")

    # THEN applications should have been created in the store
    assert all_applications_exists(store, applications_file)
예제 #6
0
def application(context: CGConfig, excel_path: str, signature: str,
                sheet_name: str, dry_run: bool):
    """Import new applications to status-db"""
    status_db: Store = context.status_db
    if not signature:
        signature: str = getpass.getuser()

    import_applications(
        store=status_db,
        excel_path=excel_path,
        sign=signature,
        dry_run=dry_run,
        sheet_name=sheet_name,
    )