def test_simple_parse(self): # file which contains the content of a tree object for filename in ['tree1', 'tree2']: o = from_filename(filename) assert o.sha1() == FILE_TO_SHA1[filename] # Testing for sha1 should be enough, but we double check here assert o.content == SHA1_TO_CONTENT[o.sha1()]
def test_simple_parse2(self): # this tree contains a subtree filename = 'tree3' o = from_filename(filename) assert o.sha1() == FILE_TO_SHA1[filename] # Testing for sha1 should be enough, but we double check here assert o.content == SHA1_TO_CONTENT[o.sha1()]
def test_parse(self): # file which contains the content of a blob object filename = 'TODO' o = from_filename(filename) try: real_filename = SHA1_TO_FILE[o.sha1()] assert real_filename == filename except KeyError: assert False, "Wrong sha1" assert o.content == SHA1_TO_CONTENT[o.sha1()]