def test_assign_storage_tagged_datastores(appliance, virtualcenter_provider):
    view = navigate_to(appliance.server, 'Chargeback')

    tagged_datastore = cb.StorageAssign(
        assign_to="Tagged Datastores",
        tag_category="Location",
        selections={'Chicago': {
            'Rate': 'Default'
        }})
    tagged_datastore.assign()

    assign_view = view.browser.create_view(AssignmentsView)
    row = assign_view.selections.row(name='Chicago')
    selected_option = row.rate.widget.selected_option
    assert selected_option == "Default", 'Selection does not match'
def test_assign_storage_enterprise(appliance, virtualcenter_provider):
    view = navigate_to(appliance.server, 'Chargeback')

    enterprise = cb.StorageAssign(
        assign_to="The Enterprise",
        selections={'Enterprise': {
            'Rate': 'Default'
        }})

    enterprise.assign()

    assign_view = view.browser.create_view(AssignmentsView)
    row = assign_view.selections.row(name='Enterprise')
    selected_option = row.rate.widget.selected_option
    assert selected_option == "Default", 'Selection does not match'
def test_assign_storage_datastores(appliance, virtualcenter_provider):
    view = navigate_to(appliance.server, 'Chargeback')

    datastore = random.choice(
        virtualcenter_provider.data["datastores"])["name"]

    sel_datastore = cb.StorageAssign(
        assign_to="Selected Datastores",
        selections={datastore: {
            'Rate': 'Default'
        }})
    sel_datastore.assign()

    assign_view = view.browser.create_view(AssignmentsView)
    row = assign_view.selections.row(name=datastore)
    selected_option = row.rate.widget.selected_option
    assert selected_option == "Default", 'Selection does not match'
def test_assign_storage_tagged_datastores(appliance, virtualcenter_provider):
    """
    Polarion:
        assignee: tpapaioa
        casecomponent: CandU
        caseimportance: medium
        initialEstimate: 1/12h
    """
    view = navigate_to(appliance.server, 'Chargeback')

    tagged_datastore = cb.StorageAssign(
        assign_to="Tagged Datastores",
        tag_category="Location",
        selections={'Chicago': {
            'Rate': 'Default'
        }})
    tagged_datastore.assign()

    assign_view = view.browser.create_view(AssignmentsView)
    row = assign_view.selections.row(name='Chicago')
    selected_option = row.rate.widget.selected_option
    assert selected_option == "Default", 'Selection does not match'
def test_assign_storage_enterprise(appliance, virtualcenter_provider):
    """
    Polarion:
        assignee: tpapaioa
        casecomponent: CandU
        caseimportance: medium
        initialEstimate: 1/12h
    """
    view = navigate_to(appliance.server, 'Chargeback')

    enterprise = cb.StorageAssign(
        assign_to="The Enterprise",
        selections={'Enterprise': {
            'Rate': 'Default'
        }})

    enterprise.assign()

    assign_view = view.browser.create_view(AssignmentsView)
    row = assign_view.selections.row(name='Enterprise')
    selected_option = row.rate.widget.selected_option
    assert selected_option == "Default", 'Selection does not match'