def test_none(self): """grouptools.commonprefix: returns '' when no values are the same""" assert grouptools.commonprefix(['foo', 'bar']) == ''
def test_basic(self): expected = grouptools.commonprefix([ grouptools.join('g1', 'g2', '1'), grouptools.join('g1', 'g2', '2') ]) assert expected == grouptools.join('g1', 'g2')
def test_empty(self): """grouptools.commonprefix: handles an empty value""" actual = grouptools.commonprefix((grouptools.join('foo', 'bar'), '')) assert actual == ''
def test_commonprefix_none(): """grouptools.commonprefix: returns '' when no values are the same""" nt.eq_('', grouptools.commonprefix(['foo', 'bar']))
def test_commonprefix_empty(): """grouptools.commonprefix: handles an empty value""" expected = '' value = grouptools.commonprefix((grouptools.join('foo', 'bar'), '')) nt.eq_(expected, value)