Skip to content

Commit

Permalink
Nomenclature update
Browse files Browse the repository at this point in the history
  • Loading branch information
f213 committed Jun 22, 2022
1 parent 3546010 commit 417cace
Showing 1 changed file with 12 additions and 21 deletions.
33 changes: 12 additions & 21 deletions src/models/item.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,20 @@ def __str__(self) -> str:


DATABASE = {
'aa-3-self': {
'user_name': 'АА-3 самостоятельный',
'name': 'Участие в курсе «Асинхронная Архитектура на плошадке education.borshev.com (тариф «самостоятельный»)',
'price': 15_500,
'teamlead-4-self': {
'user_name': 'СТ-4 самостоятельный',
'name': 'Участие в курсе «Стать Тимлидом» на плошадке education.borshev.com (тариф «самостоятельный»)',
'price': 14_000,
},
'aa-3-full': {
'user_name': 'АА-3 тусовка',
'name': 'Участие в курсе «Асинхронная Архитектура на плошадке education.borshev.com (тариф «в тусовке»)',
'price': 26_000,
'teamlead-4-full': {
'user_name': 'СТ-4 тусовка',
'name': 'Участие в курсе «Стать Тимлидом» на плошадке education.borshev.com (тариф «в тусовке»)',
'price': 24_000,
},
'aa-3-vip': {
'user_name': 'АА-3 VIP',
'name': 'Участие в курсе «Асинхронная Архитектура на плошадке education.borshev.com (тариф «VIP»)',
'price': 40_000,
'teamlead-4-vip': {
'user_name': 'СТ-4 VIP',
'name': 'Участие в курсе «Стать Тимлидом» на плошадке education.borshev.com (тариф «VIP»)',
'price': 65_000,
},
}

Expand All @@ -61,12 +61,3 @@ def parse_input(user_input: str) -> Item:
return item

return Item(name=user_input)


if __name__ == '__main__':
assert get_by_slug_or_name('aa-3-self') == Item(name='Участие в курсе «Асинхронная Архитектура на плошадке education.borshev.com (тариф «самостоятельный»)', price=15_500, amount=1)
assert get_by_slug_or_name('АА-3 тусовка') == Item(name='Участие в курсе «Асинхронная Архитектура на плошадке education.borshev.com (тариф «в тусовке»)', price=26_000, amount=1)
assert get_by_slug_or_name('Участие в курсе «Асинхронная Архитектура на плошадке education.borshev.com (тариф «VIP»)') == Item(name='Участие в курсе «Асинхронная Архитектура на плошадке education.borshev.com (тариф «VIP»)', price=40_000, amount=1) # noqa

assert parse_input('aa-3-self') == Item(name='Участие в курсе «Асинхронная Архитектура на плошадке education.borshev.com (тариф «самостоятельный»)', price=10_000, amount=1)
assert parse_input('Макароны') == Item(name='Макароны', price=0, amount=1)

0 comments on commit 417cace

Please sign in to comment.