def test_conda_forge_activity(gitrepo, gitecho): vcsutils.tag("0.0.1") env = builtins.__xonsh__.env recipe_dir = os.path.join(env["REVER_DIR"], "rever-feedstock", "recipe") meta_yaml = os.path.join(recipe_dir, "meta.yaml") os.makedirs(recipe_dir, exist_ok=True) files = [ ("rever.xsh", REVER_XSH), (meta_yaml, ORIG_META_YAML), ("credfile", CREDFILE), ] for filename, body in files: with open(filename, "w") as f: f.write(body) vcsutils.track(".") vcsutils.commit("Some versioned files") env_main(["0.1.0"]) # now see if this works with open(meta_yaml, "r") as f: obs = f.read() assert EXP_META_YAML == obs env_main(["0.2.0"]) # now see if this works with open(meta_yaml, "r") as f: obs = f.read() assert EXP_META_YAML2 == obs
def test_authors(gitrepo): vcsutils.tag('42.1.0') files = [ ('rever.xsh', REVER_XSH), ] for filename, body in files: with open(filename, 'w') as f: f.write(body) vcsutils.track('.') vcsutils.commit('initial authors') env_main(['42.1.1']) # now see if this worked files = os.listdir('.') assert 'AUTHORS.md' in files assert 'authors.yaml' in files assert 'Mailmap' in files assert 'latest.json' in files # test authors file with open('AUTHORS.md') as f: auth = f.read() assert auth.startswith( "All of the people who have made at least one contribution to WAKKA.\n" "Authors are sorted by number of commits.\n") # test latest file with open("latest.json") as f: latest = json.load(f) assert isinstance(latest, list) assert len(latest) == 1 assert isinstance(latest[0], str) assert '@' in latest[0] # ensure that the updates were commited logger = current_logger() entries = logger.load() assert entries[-2]['rev'] != entries[-1]['rev']
def test_tag_activity(gitrepo): vcsutils.tag('42.1.0') files = [ ('rever.xsh', REVER_XSH), ] for filename, body in files: with open(filename, 'w') as f: f.write(body) vcsutils.track('.') vcsutils.commit('Some versioned files') env_main(['42.1.1']) # now see if this worked current = vcsutils.latest_tag() assert '42.1.1' == current # now try to undo the tag env_main(['-u', 'tag', '42.1.1']) current = vcsutils.latest_tag() assert '42.1.0' == current # ensure that the updates were commited logger = current_logger() entries = logger.load() assert entries[-2] != entries[-1]
def test_conda_forge_activity(gitrepo, gitecho): vcsutils.tag('0.0.1') env = builtins.__xonsh__.env recipe_dir = os.path.join(env['REVER_DIR'], 'rever-feedstock', 'recipe') meta_yaml = os.path.join(recipe_dir, 'meta.yaml') os.makedirs(recipe_dir, exist_ok=True) files = [('rever.xsh', REVER_XSH), (meta_yaml, ORIG_META_YAML), ('credfile', CREDFILE)] for filename, body in files: with open(filename, 'w') as f: f.write(body) vcsutils.track('.') vcsutils.commit('Some versioned files') env_main(['0.1.0']) # now see if this works with open(meta_yaml, 'r') as f: obs = f.read() assert EXP_META_YAML == obs env_main(['0.2.0']) # now see if this works with open(meta_yaml, 'r') as f: obs = f.read() assert EXP_META_YAML2 == obs