first commit
This commit is contained in:
35
test/helpers/bom_helper_test.py
Normal file
35
test/helpers/bom_helper_test.py
Normal file
@@ -0,0 +1,35 @@
|
||||
import unittest
|
||||
|
||||
from nose.tools import eq_
|
||||
from numpy import array
|
||||
|
||||
from helix.calculators.bom_helper import get_panel_type_counts
|
||||
from helix.constants.panel_type import PanelType
|
||||
from helix.models.panel import Panel
|
||||
|
||||
|
||||
class BomHelperTest(unittest.TestCase):
|
||||
def test_get_panel_type_counts(self):
|
||||
panels = [Panel(panel_type=PanelType.Corner),
|
||||
Panel(panel_type=PanelType.NorthSouth),
|
||||
Panel(panel_type=PanelType.EastWest),
|
||||
Panel(panel_type=PanelType.Middle),
|
||||
Panel(panel_type=PanelType.Corner),
|
||||
Panel(panel_type=PanelType.EastWest),
|
||||
Panel(panel_type=PanelType.Corner),
|
||||
Panel(panel_type=PanelType.EastWest),
|
||||
Panel(panel_type=PanelType.Corner),
|
||||
Panel(panel_type=PanelType.EastWest),
|
||||
Panel(panel_type=PanelType.EastWest),
|
||||
Panel(panel_type=PanelType.EastWest),
|
||||
Panel(panel_type=PanelType.Corner),
|
||||
Panel(panel_type=PanelType.NorthSouth),
|
||||
Panel(panel_type=PanelType.EastWest)]
|
||||
|
||||
counts = get_panel_type_counts(panels)
|
||||
|
||||
eq_(counts[PanelType.Corner], 5)
|
||||
eq_(counts[PanelType.NorthSouth], 2)
|
||||
eq_(counts[PanelType.EastWest], 7)
|
||||
eq_(counts[PanelType.Middle], 1)
|
||||
|
||||
Reference in New Issue
Block a user