first commit

This commit is contained in:
Senad Uka
2017-11-07 09:23:57 +01:00
commit 0eee92660a
356 changed files with 747259 additions and 0 deletions

View 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)