Skip to content

Commit

Permalink
Run ruff and fix errors
Browse files Browse the repository at this point in the history
  • Loading branch information
sambible committed Sep 21, 2023
1 parent 3d5c881 commit 73529bc
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 43 deletions.
12 changes: 6 additions & 6 deletions airgun/entities/contentview_new.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
from navmazing import NavigateToSibling
from wait_for import wait_for

from airgun.entities.base import BaseEntity
from airgun.navigation import NavigateStep, navigator
from airgun.utils import retry_navigation
from airgun.views.contentview_new import ContentViewCreateView
from airgun.views.contentview_new import ContentViewTableView
from airgun.views.contentview_new import ContentViewEditView
from airgun.views.contentview_new import ContentViewVersionPublishView
from airgun.views.contentview_new import (
ContentViewCreateView,
ContentViewEditView,
ContentViewTableView,
ContentViewVersionPublishView,
)


class NewContentViewEntity(BaseEntity):
Expand Down Expand Up @@ -97,4 +98,3 @@ def prerequisite(self, *args, **kwargs):
def step(self, *args, **kwargs):
"""Click 'Publish new version' button"""
self.parent.publish.click()

1 change: 1 addition & 0 deletions airgun/views/common.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import time
import wait_for
from widgetastic.widget import (
Checkbox,
ConditionalSwitchableView,
Expand Down
64 changes: 27 additions & 37 deletions airgun/views/contentview_new.py
Original file line number Diff line number Diff line change
@@ -1,39 +1,30 @@
from wait_for import wait_for
from widgetastic.utils import ParametrizedLocator
from widgetastic.widget import Checkbox
from widgetastic.widget import ParametrizedView
from widgetastic.widget import Text
from widgetastic.widget import TextInput
from widgetastic.widget import View
from widgetastic_patternfly import BreadCrumb
from widgetastic_patternfly import Tab
from widgetastic_patternfly4 import Button
from widgetastic_patternfly4 import Dropdown
from widgetastic_patternfly4.ouia import Button as PF4Button
from widgetastic_patternfly4.ouia import ExpandableTable
from widgetastic_patternfly4.ouia import Switch
from widgetastic_patternfly4.ouia import PatternflyTable

from airgun.views.common import BaseLoggedInView
from airgun.views.common import NewAddRemoveResourcesView
from airgun.views.common import SearchableViewMixinPF4
from airgun.widgets import ActionsDropdown
from airgun.widgets import ConfirmationDialog
from airgun.widgets import EditableEntry
from airgun.widgets import PF4Search
from airgun.widgets import PF4ProgressBar
from airgun.widgets import ReadOnlyEntry
from airgun.views.common import BaseLoggedInView
from airgun.views.common import NewAddRemoveResourcesView
from airgun.views.common import SearchableViewMixinPF4
from airgun.widgets import ActionsDropdown
from airgun.widgets import ConfirmationDialog
from airgun.widgets import EditableEntry
from airgun.widgets import PF4Search
from airgun.widgets import PF4ProgressBar
from airgun.widgets import ReadOnlyEntry

from airgun.views.common import BaseLoggedInView, SearchableViewMixinPF4
from widgetastic.widget import Checkbox, Text, TextInput, View
from widgetastic_patternfly import BreadCrumb, Tab
from widgetastic_patternfly4 import Button, Dropdown
from widgetastic_patternfly4.ouia import (
Button as PF4Button,
ExpandableTable,
PatternflyTable,
Switch,
)

from airgun.views.common import (
BaseLoggedInView,
NewAddRemoveResourcesView,
SearchableViewMixinPF4,
)
from airgun.widgets import (
ActionsDropdown,
ConfirmationDialog,
EditableEntry,
PF4ProgressBar,
PF4Search,
ReadOnlyEntry,
)

LOCATION_NUM = 3


class ContentViewTableView(BaseLoggedInView, SearchableViewMixinPF4):
Expand Down Expand Up @@ -106,7 +97,7 @@ def is_displayed(self):
breadcrumb_loaded = self.browser.wait_for_element(self.breadcrumb, exception=False)
return (
breadcrumb_loaded
and len(self.breadcrumb.locations) <= 3
and len(self.breadcrumb.locations) <= LOCATION_NUM
and self.breadcrumb.locations[0] == 'Content Views'
and self.breadcrumb.read() != 'New Content View'
and self.publish.is_displayed
Expand Down Expand Up @@ -228,8 +219,7 @@ def is_displayed(self):
breadcrumb_loaded = self.browser.wait_for_element(self.breadcrumb, exception=False)
return (
breadcrumb_loaded
and len(self.breadcrumb.locations) > 3
and len(self.breadcrumb.locations) > LOCATION_NUM
and self.breadcrumb.locations[0] == 'Content Views'
and self.breadcrumb.locations[2] == 'Versions'
)

0 comments on commit 73529bc

Please sign in to comment.