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

    nt.eq_(expected, value)
예제 #6
0
def test_commonprefix_none():
    """grouptools.commonprefix: returns '' when no values are the same"""
    nt.eq_('', grouptools.commonprefix(['foo', 'bar']))
예제 #7
0
def test_commonprefix_empty():
    """grouptools.commonprefix: handles an empty value"""
    expected = ''
    value = grouptools.commonprefix((grouptools.join('foo', 'bar'), ''))

    nt.eq_(expected, value)