예제 #1
0
    def test_init(self):
        p = project.Config()
        p.__class__._instances = {}
        p = project.Config()

        assert (p._rootpath == os.getcwd())
        assert (p._workdir == os.getcwd())
예제 #2
0
def tempdir():
    with TempDirectory() as dir:
        original_dir = os.getcwd()
        os.chdir(dir.path)

        p = project.Config()
        p.__class__._instances = {}

        project.Config(dir.path)
        yield dir
        os.chdir(original_dir)
예제 #3
0
    def test_init_params(self,dir):
        subdir = dir.makedir('abc')
        dir.write('__main__.py', b'')
        dir.write('abc/test.ipynb', b'')

        p = project.Config()
        p.__class__._instances={};
        p = project.Config(subdir, os.path.join(subdir, 'test.ipynb'))

        assert(p._rootpath==dir.path)
        assert(p._filename==os.path.join(subdir,'test.ipynb'))
        assert(p._workdir==subdir)
예제 #4
0
 def test_emptydir(self, dir):
     project.Config()._workdir = None
     assert(project.rootpath()==dir.path)