Configlibarry zum Auslesen aller Werte aller benötigten Informationen aus den Config files erstellt
This commit is contained in:
+84
-3
@@ -284,7 +284,7 @@ class TestWerkstoffeFromLocalConfigs(unittest.TestCase):
|
||||
|
||||
WKST_CFG = manage_configs.WerkstoffeConfig(self.config_dir, 'Werkstoff.cfg')
|
||||
|
||||
steels = WKST_CFG.get_werkstoffe_of_type("Stahl")
|
||||
steels = WKST_CFG.get_werkstoffe_of_name("Stahl")
|
||||
result = ['1.0035 (S185)', '1.0038 (S235JR)', '1.0122 (S235JRC)',
|
||||
'1.0122+C (S235JRC+C)', '1.0330 (DC01)', '1.0401 (C15)',
|
||||
'1.0501 (C35)', '1.0503 (C45)', '1.0503+N (C45+N)',
|
||||
@@ -296,7 +296,7 @@ class TestWerkstoffeFromLocalConfigs(unittest.TestCase):
|
||||
'siehe Hersteller' ]
|
||||
self.assertCountEqual(steels, result)
|
||||
|
||||
steels = WKST_CFG.get_werkstoffe_of_type("Aluminium")
|
||||
steels = WKST_CFG.get_werkstoffe_of_name("Aluminium")
|
||||
result = [ "EN AW-1050A (3.0255)", "EN AW-2007 (3.1645)", "EN AW-2014-T3 (3.1255-T3)",
|
||||
"EN AW-2014-T4 (3.1255-T4)", "EN AW-6060 (3.3206)",
|
||||
"EN AW-6060-T66 (3.3206-T66)", "EN AW-7075 (3.4365)",
|
||||
@@ -360,12 +360,93 @@ siehe Hersteller
|
||||
WKST_CFG = manage_configs.WerkstoffeConfig()
|
||||
WKST_CFG.from_cfg_str(self.wkstoffe)
|
||||
|
||||
steels = WKST_CFG.get_werkstoffe_of_type("Stahl")
|
||||
steels = WKST_CFG.get_werkstoffe_of_name("Stahl")
|
||||
|
||||
result = ["1.0035 (S185)", "1.0038 (S235JR)", "1.0122 (S235JRC)",
|
||||
"1.0122+C (S235JRC+C)", "1.0330 (DC01)", "1.0401 (C15)", "1.0501 (C35)",
|
||||
"1.0503 (C45)", "1.0503+N (C45+N)", "siehe Hersteller"]
|
||||
self.assertCountEqual(steels, result)
|
||||
|
||||
class TestAllgmein(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
|
||||
self.allgemein = """
|
||||
|
||||
[Kategorien]
|
||||
Baugruppe
|
||||
Einzelteil
|
||||
Kaufteil
|
||||
NichtSivas
|
||||
Normteil
|
||||
Schweissbaugruppe
|
||||
|
||||
[Dispogruppe]
|
||||
Fahrstrecke=10
|
||||
Förderer=20
|
||||
Gerüst=30
|
||||
Betriebsmittel=40
|
||||
Automation=50
|
||||
Kleinteil=60
|
||||
Rohmaterial=70
|
||||
Sonstiges Intern=80
|
||||
Baustelleneinrichtung=90
|
||||
Sonderkonstruktionen=100
|
||||
|
||||
[Dispolaufgruppe]
|
||||
Omniflo=10
|
||||
Intra Logistic System + alt-HFS=20
|
||||
Fremd-Transportsysteme + SSG-Anbauten=30
|
||||
Spinnereikomponente=40
|
||||
Automotiv=45
|
||||
Nicht eindeutig, Sonder=50
|
||||
|
||||
[Kalkulationsart]
|
||||
Eigenbau
|
||||
Kaufteil
|
||||
Mischteil
|
||||
"""
|
||||
|
||||
def test_get_allgmein(self):
|
||||
"""
|
||||
get list of sections in allgmein
|
||||
"""
|
||||
|
||||
ALLG_CFG = manage_configs.AllgmeinConfig()
|
||||
ALLG_CFG.from_cfg_str(self.allgemein)
|
||||
|
||||
allg_secs = ALLG_CFG.get_sections()
|
||||
result = ['Kategorien', 'Dispogruppe', 'Dispolaufgruppe', 'Kalkulationsart']
|
||||
self.assertCountEqual(allg_secs, result)
|
||||
|
||||
opts = ALLG_CFG.get_options('Kalkulationsart')
|
||||
result = ['Eigenbau', 'Kaufteil', 'Mischteil']
|
||||
self.assertCountEqual(opts, result)
|
||||
|
||||
opts = ALLG_CFG.get_options('Dispolaufgruppe')
|
||||
result = ['Omniflo', 'Intra Logistic System + alt-HFS',
|
||||
'Fremd-Transportsysteme + SSG-Anbauten',
|
||||
'Spinnereikomponente', 'Automotiv', "Nicht eindeutig, Sonder"]
|
||||
self.assertCountEqual(opts, result)
|
||||
|
||||
val = ALLG_CFG.get_int('Dispolaufgruppe', 'Omniflo')
|
||||
self.assertEqual(val, 10)
|
||||
|
||||
dint = ALLG_CFG.get_dict('Dispogruppe')
|
||||
res = { 'Fahrstrecke':10,
|
||||
'Förderer':20,
|
||||
'Gerüst':30,
|
||||
'Betriebsmittel':40,
|
||||
'Automation':50,
|
||||
'Kleinteil':60,
|
||||
'Rohmaterial':70,
|
||||
'Sonstiges Intern':80,
|
||||
'Baustelleneinrichtung':90,
|
||||
'Sonderkonstruktionen':100,
|
||||
}
|
||||
self.assertCountEqual(dint, res)
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user