enabled load keyword in repo __init__
This commit is contained in:
parent
7b66a4697d
commit
c7a8ada751
@ -33,6 +33,8 @@ class Repository(object):
|
||||
"""
|
||||
self.config = config
|
||||
self.citekeys = []
|
||||
if load:
|
||||
self.load()
|
||||
|
||||
# @classmethod
|
||||
# def from_directory(cls, config, papersdir=None):
|
||||
|
@ -19,7 +19,7 @@ class TestCitekeyGeneration(unittest.TestCase):
|
||||
self.assertEqual(_base27(26+i+1), 'a' + chr(97+i))
|
||||
|
||||
def test_generated_key_is_unique(self):
|
||||
repo = Repository(configs.Config())
|
||||
repo = Repository(configs.Config(), load = False)
|
||||
repo.citekeys = ['Turing1950', 'Doe2003']
|
||||
c = repo.generate_citekey(fixtures.turing1950)
|
||||
repo.citekeys.append('Turing1950a')
|
||||
@ -31,7 +31,7 @@ class TestRepo(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
self.tmpdir = tempfile.mkdtemp()
|
||||
self.repo = Repository(configs.Config(papers_dir = self.tmpdir))
|
||||
self.repo = Repository(configs.Config(papers_dir = self.tmpdir), load = False)
|
||||
self.repo.init_dirs()
|
||||
self.repo.add_paper(fixtures.turing1950)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user