comparison tests/test-commandserver.py @ 15542:e19302598df8

tests: make test-commandserver.py independent of line ending and slash direction
author Mads Kiilerich <mads@kiilerich.com>
date Mon, 21 Nov 2011 00:39:32 +0100
parents 3aee6e26b28b
children 6548a2e32285
comparison
equal deleted inserted replaced
15541:3aee6e26b28b 15542:e19302598df8
126 126
127 def cwd(server): 127 def cwd(server):
128 """ check that --cwd doesn't persist between requests """ 128 """ check that --cwd doesn't persist between requests """
129 readchannel(server) 129 readchannel(server)
130 os.mkdir('foo') 130 os.mkdir('foo')
131 f = open('foo/bar', 'w') 131 f = open('foo/bar', 'wb')
132 f.write('a') 132 f.write('a')
133 f.close() 133 f.close()
134 runcommand(server, ['--cwd', 'foo', 'st', 'bar']) 134 runcommand(server, ['--cwd', 'foo', 'st', 'bar'])
135 runcommand(server, ['st', 'foo/bar']) 135 runcommand(server, ['st', 'foo/bar'])
136 os.remove('foo/bar') 136 os.remove('foo/bar')
143 # the cached repo local hgrc contains ui.foo=bar, so showconfig should show it 143 # the cached repo local hgrc contains ui.foo=bar, so showconfig should show it
144 runcommand(server, ['showconfig']) 144 runcommand(server, ['showconfig'])
145 145
146 # but not for this repo 146 # but not for this repo
147 runcommand(server, ['init', 'foo']) 147 runcommand(server, ['init', 'foo'])
148 runcommand(server, ['-R', 'foo', 'showconfig']) 148 runcommand(server, ['-R', 'foo', 'showconfig', 'ui', 'defaults'])
149 shutil.rmtree('foo') 149 shutil.rmtree('foo')
150 150
151 def hook(**args): 151 def hook(**args):
152 print 'hook talking' 152 print 'hook talking'
153 print 'now try to read something: %r' % sys.stdin.read() 153 print 'now try to read something: %r' % sys.stdin.read()
158 'hooks.pre-identify=python:test-commandserver.hook', 'id'], 158 'hooks.pre-identify=python:test-commandserver.hook', 'id'],
159 input=cStringIO.StringIO('some input')) 159 input=cStringIO.StringIO('some input'))
160 160
161 def outsidechanges(server): 161 def outsidechanges(server):
162 readchannel(server) 162 readchannel(server)
163 os.system('echo a >> a && hg ci -Am2') 163 f = open('a', 'ab')
164 f.write('a\n')
165 f.close()
166 os.system('hg ci -Am2')
164 runcommand(server, ['tip']) 167 runcommand(server, ['tip'])
165 168
166 def bookmarks(server): 169 def bookmarks(server):
167 readchannel(server) 170 readchannel(server)
168 runcommand(server, ['bookmarks']) 171 runcommand(server, ['bookmarks'])