def __init__(self, source_path, config): self.source_path = source_path # Glob over the source path results collection results = os.listdir(os.path.expanduser(source_path)) Result = result.result_model(config) self.results = [Result(os.path.join(source_path, res)) for res in results] if 'optional_properties' in config: for optional_test, optional_config in config['optional_properties'].iteritems(): self.results = [aresult.upgrade(optional_config, optional_test) for aresult in self.results]
#!/usr/bin/env python # # Copyright (C) University College London, 2007-2012, all rights reserved. # # This file is part of HemeLB and is provided to you under the terms of # the GNU LGPL. Please see LICENSE in the top level directory for full # details. # import os import unittest import fixtures import result Result=result.result_model(fixtures.ResultsConfig('example')) class TestResult(unittest.TestCase): def setUp(self): self.rc=Result(fixtures.Results('cylinders').result_path(0)) def test_construct(self): self.assertEqual(fixtures.Results('cylinders').result_path(0),self.rc.path) def test_name_property(self): self.assertEqual('planck',self.rc.machine) def test_text_property(self): self.assertEqual(1,self.rc.cores) self.assertEqual('Release',self.rc.build_type) def test_xml_property(self): self.assertEqual(2.19,self.rc.total) self.assertEqual(1000,self.rc.steps) def test_property_count(self):
# # Copyright (C) University College London, 2007-2012, all rights reserved. # # This file is part of HemeLB and is CONFIDENTIAL. You may not work # with, install, use, duplicate, modify, redistribute or share this # file, or any part thereof, other than as allowed by any agreement # specifically made by you with University College London. # import os import unittest import fixtures import result Result = result.result_model(fixtures.ResultsConfig('extraction')) class TestExtraction(unittest.TestCase): def setUp(self): self.rc = Result(fixtures.Results('extractions').result_path(0)) def test_construct(self): self.assertEqual( fixtures.Results('extractions').result_path(0), self.rc.path) def test_name_property(self): self.assertEqual('cylRe1VxSz8.0e-05_80b9322046ce_localhost_4_10_10', self.rc.name) def test_field_count(self): self.assertEqual(1, self.rc.axial_field_count)
# This file is part of HemeLB and is Copyright (C) # the HemeLB team and/or their institutions, as detailed in the # file AUTHORS. This software is provided under the terms of the # license in the file LICENSE. import os import unittest import fixtures import result Result=result.result_model(fixtures.ResultsConfig('extraction')) class TestExtraction(unittest.TestCase): def setUp(self): self.rc=Result(fixtures.Results('extractions').result_path(0)) def test_construct(self): self.assertEqual(fixtures.Results('extractions').result_path(0),self.rc.path) def test_name_property(self): self.assertEqual('cylRe1VxSz8.0e-05_80b9322046ce_localhost_4_10_10',self.rc.name) def test_field_count(self): self.assertEqual(1,self.rc.axial_field_count) def test_field_mean(self): self.assertAlmostEqual(80.0,self.rc.axial_mean_pressure,5) def test_extract_voxel_size(self): self.assertEqual(8e-05,self.rc.voxel_size)
# # Copyright (C) University College London, 2007-2012, all rights reserved. # # This file is part of HemeLB and is CONFIDENTIAL. You may not work # with, install, use, duplicate, modify, redistribute or share this # file, or any part thereof, other than as allowed by any agreement # specifically made by you with University College London. # import os import unittest import fixtures import result Result = result.result_model(fixtures.ResultsConfig('example')) class TestResult(unittest.TestCase): def setUp(self): self.rc = Result(fixtures.Results('cylinders').result_path(0)) def test_construct(self): self.assertEqual( fixtures.Results('cylinders').result_path(0), self.rc.path) def test_name_property(self): self.assertEqual('planck', self.rc.machine) def test_text_property(self): self.assertEqual(1, self.rc.cores)