def test_with_unrecognised_name(self): with self.assertRaises(AttributeError): ext_names_to_ids("foobar")
def test_with_id_and_name(self): ret = ext_names_to_ids("0 heartbeat") self.assertEqual(ret, [0, 15])
def test_with_two_ids(self): ret = ext_names_to_ids("0 1") self.assertEqual(ret, [0, 1])
def test_with_id(self): ret = ext_names_to_ids("0") self.assertEqual(ret, [0])
def test_with_name(self): ret = ext_names_to_ids("server_name") self.assertEqual(ret, [0])
def test_with_empty(self): ret = ext_names_to_ids("") self.assertEqual(ret, [])