def test_ppc_device_tree_parsing(self, test_input, expected_result): with namedTemporaryDir() as tmpdir: with tempfile.NamedTemporaryFile(dir=tmpdir) as f: f.write(test_input) f.flush() result = ppc64HardwareInfo._from_device_tree( os.path.basename(f.name), tree_path=tmpdir) self.assertEqual(expected_result, result)
def test_ppc_device_tree_parsing(self, test_input, expected_result): with namedTemporaryDir() as tmpdir: with tempfile.NamedTemporaryFile(dir=tmpdir) as f: f.write(test_input) f.flush() result = ppc64HardwareInfo._from_device_tree(os.path.basename( f.name), tree_path=tmpdir) self.assertEqual(expected_result, result)
def test_ppc_device_tree_no_file(self): result = ppc64HardwareInfo._from_device_tree('nonexistent', tree_path='/tmp') self.assertEqual('unavailable', result)
def test_ppc_device_tree_no_file(self): result = ppc64HardwareInfo._from_device_tree( 'nonexistent', tree_path='/tmp') self.assertEqual('unavailable', result)