Example #1
0
 def setUp(self):
     '''
     Set up test variables and loggers
     '''
     self.schFilename = os.path.join(os.getcwd(), 'testSchematic.sch')
     self.bomFilename = os.path.join(os.getcwd(), 'testSchematic.bom')
     self.logger = logging.getLogger('testSchematicParser')
     self.logger.setLevel(logging.INFO)
     #handler = logging.StreamHandler()
     handler = logging.NullHandler()
     self.logger.addHandler(handler)
     '''
     BomOrganizer
     '''
     '''
     Parse Schematic File
     '''
     self.parser = sp.SchematicParser(self.schFilename, self.logger)
     self.bomOrganizer = bo.BOMOrganizer(self.parser.parse())
Example #2
0
 def testIter(self):
     self.bom = bo.BOMOrganizer(self._createDummyComponentList())
     for component in self.bom:
         self.assertTrue(component.hasAttribute('refdes'))
Example #3
0
 def testParsedSchematic(self):
     self.bom = bo.BOMOrganizer(self._getSchematicComponentList())
     self.assertEqual(self.bom.getBOM()[0].getQuantity(), 4,
                      "BOMOrganizer problem parsing from schematic")
Example #4
0
    def testParsedSchematicWithVendorParse(self):

        self.bom = bo.BOMOrganizer(self._getSchematicComponentList())
        self.bom.addVendorInfo()
Example #5
0
 def testOrganize(self):
     self.bom = bo.BOMOrganizer(self._createDummyComponentList())
     self.assertEqual(self.bom.getBOM()[0].getQuantity(), 2,
                      "Organize function not correct")