def test_singular2plural(): r"""Test conversion from singular element names to plural ones and back.""" pairs = [('face', 'faces'), ('vertex', 'vertices'), ('vertex_index', 'vertex_indices')] for s, p in pairs: assert(PlyMetaschemaType.singular2plural(s) == p) assert(PlyMetaschemaType.plural2singular(p) == s) with pytest.raises(ValueError): PlyMetaschemaType.plural2singular('invalid')
def test_singular2plural(): r"""Test conversion from singular element names to plural ones and back.""" pairs = [('face', 'faces'), ('vertex', 'vertices'), ('vertex_index', 'vertex_indices')] for s, p in pairs: assert_equal(PlyMetaschemaType.singular2plural(s), p) assert_equal(PlyMetaschemaType.plural2singular(p), s) assert_raises(ValueError, PlyMetaschemaType.plural2singular, 'invalid')