From e5b8cb0f7050224a3d904210f46b46a5e875e54e Mon Sep 17 00:00:00 2001 From: Kevin Hock Date: Mon, 6 Nov 2017 17:50:24 -0800 Subject: [PATCH] Keep original test as is --- tests/commands/autoupdate_test.py | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/tests/commands/autoupdate_test.py b/tests/commands/autoupdate_test.py index 584400cd..53670ca2 100644 --- a/tests/commands/autoupdate_test.py +++ b/tests/commands/autoupdate_test.py @@ -114,6 +114,26 @@ def test_autoupdate_out_of_date_repo( ) write_config('.', config) + runner = Runner('.', C.CONFIG_FILE) + before = open(C.CONFIG_FILE).read() + # It will update the repo, because the name matches + ret = autoupdate(runner, tags_only=False) + after = open(C.CONFIG_FILE).read() + assert ret == 0 + assert before != after + # Make sure we don't add defaults + assert 'exclude' not in after + assert out_of_date_repo.head_sha in after + +def test_autoupdate_out_of_date_repo_with_correct_repo_name( + out_of_date_repo, in_tmpdir, mock_out_store_directory, +): + # Write out the config + config = make_config_from_repo( + out_of_date_repo.path, sha=out_of_date_repo.original_sha, check=False, + ) + write_config('.', config) + runner = Runner('.', C.CONFIG_FILE) before = open(C.CONFIG_FILE).read() repo_name = 'file://{}'.format(out_of_date_repo.path) @@ -126,8 +146,7 @@ def test_autoupdate_out_of_date_repo( assert 'exclude' not in after assert out_of_date_repo.head_sha in after - -def test_autoupdate_out_of_date_repo_wrong_repo_name( +def test_autoupdate_out_of_date_repo_with_wrong_repo_name( out_of_date_repo, in_tmpdir, mock_out_store_directory, ): # Write out the config @@ -144,7 +163,6 @@ def test_autoupdate_out_of_date_repo_wrong_repo_name( assert ret == 0 assert before == after - def test_does_not_reformat( out_of_date_repo, mock_out_store_directory, in_tmpdir, ):