mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-12-03 05:09:58 -05:00
Fixing a few bugs in preparation for sneak peek.
This commit is contained in:
parent
064147a769
commit
474e68cc3d
8 changed files with 119 additions and 20 deletions
26
modules/inventory/conftest.py
Normal file
26
modules/inventory/conftest.py
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
import pytest
|
||||
|
||||
from modules.inventory import Inventory, Item, DEFAULT_CATEGORIES, DEFAULT_INVENTORIES
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def test_inventory(test_session):
|
||||
inventory = Inventory(name='Test Inventory')
|
||||
test_session.add(inventory)
|
||||
test_session.commit()
|
||||
return inventory
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def init_test_inventory(test_session):
|
||||
for subcategory, category in DEFAULT_CATEGORIES:
|
||||
item = Item(subcategory=subcategory, category=category)
|
||||
test_session.add(item)
|
||||
|
||||
for name in DEFAULT_INVENTORIES:
|
||||
inv = Inventory(name=name)
|
||||
test_session.add(inv)
|
||||
|
||||
inventory = test_session.query(Inventory).filter_by(name='Food Storage').one()
|
||||
test_session.commit()
|
||||
return inventory
|
||||
Loading…
Add table
Add a link
Reference in a new issue