#
# Copyright (c) Daniel Sheffield 2023
#
# All rights reserved
#
# THIS SOFTWARE IS PROVIDED AS IS WITHOUT WARRANTY
from app import COPYRIGHT
from app.activities.Banner import banner
from urwid import Text, Pile, AttrMap, Padding

def test_banner():
    myBanner = banner('test-banner')
    assert isinstance(myBanner.original_widget, Pile)
    assert isinstance(myBanner, AttrMap)
    contents = myBanner.original_widget.contents
    assert len(contents) == 2
    for (w,_), expected in zip(contents, [
        'test-banner',
        COPYRIGHT
    ]):
        assert isinstance(w, Padding)
        original = w.original_widget
        assert isinstance(original, Text)
        assert original.get_text()[0] == expected
