Example #1
0
 def test_default_node_context(self):
     ctx = MockContext()
     context_stack = node_context(ctx)
     assert type(context_stack) == ExitStack
     assert len(context_stack._exit_callbacks) == 1
Example #2
0
 def test_node_context_accepts_more_contexts(self):
     ctx = MockContext()
     context_stack = node_context(ctx, ctx.cd('boop'))
     assert type(context_stack) == ExitStack
     assert len(context_stack._exit_callbacks) == 2
 def test_it_appends_nvm_when_nvmrc_exists(self, patch_clone_dir):
     create_file(patch_clone_dir / NVMRC, '4.2')
     ctx = MockContext()
     context_stack = node_context(ctx)
     assert type(context_stack) == ExitStack
     assert len(context_stack._exit_callbacks) == 2