Skip to content

Commit

Permalink
Add tests modules
Browse files Browse the repository at this point in the history
  • Loading branch information
HeaTTheatR committed Aug 11, 2022
1 parent 779a851 commit 1876772
Showing 1 changed file with 67 additions and 0 deletions.
67 changes: 67 additions & 0 deletions kivymd/tests/test_list.py
@@ -0,0 +1,67 @@
from kivymd.tests.base_test import BaseTest


class ListTest(BaseTest):
def test_list_raw_app(self):
import os

from kivymd import images_path
from kivymd.uix.list import (
IconLeftWidget,
IconRightWidget,
ImageLeftWidget,
IRightBodyTouch,
MDList,
OneLineAvatarIconListItem,
OneLineAvatarListItem,
OneLineIconListItem,
OneLineListItem,
ThreeLineListItem,
TwoLineListItem,
)
from kivymd.uix.screen import MDScreen
from kivymd.uix.scrollview import MDScrollView
from kivymd.uix.selectioncontrol import MDCheckbox

class RightCheckbox(IRightBodyTouch, MDCheckbox):
pass

self.render(
MDScreen(
MDScrollView(
MDList(
OneLineListItem(text="Text"),
TwoLineListItem(
text="Text", secondary_text="secondary text"
),
ThreeLineListItem(
text="Text",
secondary_text="secondary text",
tertiary_text="tertiary text",
),
OneLineAvatarListItem(
ImageLeftWidget(
source=os.path.join(
images_path, "logo", "kivymd-icon-512.png"
)
),
text="Text",
),
OneLineIconListItem(
IconLeftWidget(icon="plus"),
text="Text",
),
OneLineAvatarIconListItem(
IconLeftWidget(icon="plus"),
IconRightWidget(icon="minus"),
text="Text",
),
OneLineAvatarIconListItem(
IconLeftWidget(icon="plus"),
RightCheckbox(),
text="Text",
),
)
)
)
)

0 comments on commit 1876772

Please sign in to comment.