예제 #1
0
파일: hwinfo_test.py 프로젝트: nirs/vdsm
 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)
예제 #2
0
 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)
예제 #3
0
 def test_ppc_device_tree_no_file(self):
     result = ppc64HardwareInfo._from_device_tree('nonexistent',
                                                  tree_path='/tmp')
     self.assertEqual('unavailable', result)
예제 #4
0
파일: hwinfo_test.py 프로젝트: nirs/vdsm
 def test_ppc_device_tree_no_file(self):
     result = ppc64HardwareInfo._from_device_tree(
         'nonexistent', tree_path='/tmp')
     self.assertEqual('unavailable', result)