def test_branch_id_to_path(self):
     # branch_id_to_path converts an integer branch ID into a path of four
     # segments, with each segment being a hexadecimal number.
     self.assertEqual('00/00/00/00', branch_id_to_path(0))
     self.assertEqual('00/00/00/01', branch_id_to_path(1))
     arbitrary_large_id = 6731
     assert "%x" % arbitrary_large_id == '1a4b', (
         "The arbitrary large id is not what we expect (1a4b): %s" %
         (arbitrary_large_id))
     self.assertEqual('00/00/1a/4b', branch_id_to_path(6731))
 def test_branch_id_to_path(self):
     # branch_id_to_path converts an integer branch ID into a path of four
     # segments, with each segment being a hexadecimal number.
     self.assertEqual('00/00/00/00', branch_id_to_path(0))
     self.assertEqual('00/00/00/01', branch_id_to_path(1))
     arbitrary_large_id = 6731
     assert "%x" % arbitrary_large_id == '1a4b', (
         "The arbitrary large id is not what we expect (1a4b): %s"
         % (arbitrary_large_id))
     self.assertEqual('00/00/1a/4b', branch_id_to_path(6731))
def branch_to_path(branch, add_slash=True):
    path = branch_id_to_path(branch.id)
    if add_slash:
        path += '/'
    return path
def branch_to_path(branch, add_slash=True):
    path = branch_id_to_path(branch.id)
    if add_slash:
        path += '/'
    return path