solutions

Simple Class Attribute

Write a simple class Cookie that contains two class attributes:

  • DEFAULT_SCARF_COLOR: must be 'Green' by default
  • DEFAULT_BUTTON_COLOR: must be 'Blue' by default
print(Cookie.DEFAULT_SCARF_COLOR)  # 'Green'

Test Cases

test attributes - Run Test

def test_attributes():
    assert Cookie.DEFAULT_SCARF_COLOR == 'Green'
    assert Cookie.DEFAULT_BUTTON_COLOR == 'Blue'