예제 #1
0
파일: caps_test.py 프로젝트: minqf/vdsm
 def test_parse_node_version(self):
     inputs = (b'', b'VERSION = 1\n', b'RELEASE = 2\n',
               b'VERSION = 1\nRELEASE = 2\n', b'VERSIO = 1\nRELEASE = 2\n')
     expected_results = (('', ''), ('1', ''), ('', '2'), ('1', '2'), ('',
                                                                      '2'))
     for test_input, expected_result in zip(inputs, expected_results):
         with tempfile.NamedTemporaryFile() as f:
             f.write(test_input)
             f.flush()
             self.assertEqual(osinfo._parse_node_version(f.name),
                              expected_result)
예제 #2
0
파일: caps_test.py 프로젝트: nirs/vdsm
 def test_parse_node_version(self):
     inputs = (b'',
               b'VERSION = 1\n',
               b'RELEASE = 2\n',
               b'VERSION = 1\nRELEASE = 2\n',
               b'VERSIO = 1\nRELEASE = 2\n')
     expected_results = (('', ''),
                         ('1', ''),
                         ('', '2'),
                         ('1', '2'),
                         ('', '2'))
     for test_input, expected_result in zip(inputs, expected_results):
         with tempfile.NamedTemporaryFile() as f:
             f.write(test_input)
             f.flush()
             self.assertEqual(osinfo._parse_node_version(f.name),
                              expected_result)