# HG changeset patch # User Steve Losh # Date 1254685229 14400 # Node ID 3e7777d0654ec9f64bbdfec6db1af57f152e9df3 # Parent 896d4023c274f97194b7b11f0122ee31960ee770 Add some sample data for sandboxing. diff -r 896d4023c274 -r 3e7777d0654e review/tests/__init__.py diff -r 896d4023c274 -r 3e7777d0654e review/tests/sample_data.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/review/tests/sample_data.py Sun Oct 04 15:40:29 2009 -0400 @@ -0,0 +1,8 @@ +log = [ + { 'file_one': 'hello\nworld', + 'file_two': 'this is another test file', + }, + { 'file_one': 'hello again\nworld'}, + 'file_three': 'this is a new file\nfor testing', + }, +] \ No newline at end of file diff -r 896d4023c274 -r 3e7777d0654e review/tests/test_init.py --- a/review/tests/test_init.py Sun Oct 04 15:32:39 2009 -0400 +++ b/review/tests/test_init.py Sun Oct 04 15:40:29 2009 -0400 @@ -1,6 +1,7 @@ from nose import * from mercurial import commands, hg, ui import os, shutil +import sample_data sandbox_path = os.path.join(os.path.realpath('.'), 'hgreview_test') @@ -10,10 +11,18 @@ os.chdir(sandbox_path) commands.init(ui.ui()) + sandbox = get_sandbox_repo() + + opts = {'addremove': True, 'date': None, 'user': 'Review Tester', 'logfile': None} + for state in sample_data.log: + for filename in state: + with open(filename, 'w') as f: + f.write(state[filename]) + commands.commit(ui.ui(), sandbox, message="Sandbox commit.") def teardown_sandbox(): os.chdir(os.path.realpath(os.path.join(sandbox_path, os.pardir))) - shutil.rmtree(sandbox_path) + # shutil.rmtree(sandbox_path) def get_sandbox_repo(): return hg.repository(ui.ui(), '.')