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)