Patch the gitfs opts with custom opts and not master opts.

It worked but this was, as it was, it's more explicit
This commit is contained in:
Pedro Algarvio 2014-06-15 13:25:21 +01:00
parent 0a10c4d2c7
commit 9e1634d386

View File

@ -131,6 +131,7 @@ class GitFSTest(integration.ModuleCase):
'sock_dir': self.master_opts['sock_dir'],
'hash_type': 'blob_sha1'}):
tmp_load = LOAD.copy()
tmp_load['loc'] = 0
tmp_load['path'] = 'testfile'
fnd = {'rel': 'testfile',
'path': 'testfile'}
@ -138,12 +139,16 @@ class GitFSTest(integration.ModuleCase):
self.assertDictEqual({'hash_type': 'blob_sha1', 'hsum': '0d234303e6451128d756c5c259175de37d767742'}, ret)
def test_serve_file(self):
with patch.dict(gitfs.__opts__, self.master_opts):
with patch.dict(gitfs.__opts__, {'cachedir': self.master_opts['cachedir'],
'gitfs_remotes': ['file://' + self.tmp_repo_git],
'sock_dir': self.master_opts['sock_dir'],
'file_buffer_size': 262144}):
fnd = {'rel': 'testfile',
'path': 'testfile'}
tmp_load = LOAD.copy()
tmp_load['loc'] = tmp_load['path'] = 0
tmp_load['loc'] = 0
tmp_load['path'] = 'testfile'
ret = gitfs.serve_file(tmp_load, fnd)
self.assertDictEqual({