code: def test_run_notebook(self):
      self.__set_variables()
      # Update the default Dockerfile to test with
      with open(self.env_def_path, "wb") as f:
          f.write(to_bytes("FROM nbgallery/jupyter-alpine:latest"))
  
      # Test success case
      test_command = ["jupyter", "notebook", "list"]
      test_ports = ["8888:8888", "9999:9999"]
      test_mem_limit = "4g"
  
      # test single ports option before command
      self.run_command.parse(
          [
              "run",
              "--ports",
              test_ports[0],
              "--mem-limit",
              test_mem_limit,
              test_command,
          ]
      )
  
      # test for desired side effects
      assert self.run_command.args.cmd == test_command
      assert self.run_command.args.ports == [test_ports[0]]
      assert self.run_command.args.mem_limit == test_mem_limit
  
      # test multiple ports option before command
      self.run_command.parse(
          [
              "run",
              "--ports",
              test_ports[0],
              "--ports",
              test_ports[1],
              "--mem-limit",
              test_mem_limit,
              "--environment-paths",
              self.env_def_path,
              test_command,
          ]
      )
  
      # test for desired side effects
      assert self.run_command.args.cmd == test_command
      assert self.run_command.args.ports == test_ports
      assert self.run_command.args.mem_limit == test_mem_limit
  
      # test proper execution of run command
      result = self.run_command.execute()
      assert result
      assert isinstance(result, Run)
      assert result.logs
      assert "Currently running servers" in result.logs
      assert result.status == "SUCCESS"
  
      # teardown
      self.run_command.parse(["stop", "--all"])
      # test when all is passed to stop all
      self.run_command.execute()
  
imports: from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  import os
  import glob
  import time
  import tempfile
  import platform
  from argparse import ArgumentError
  from io import open
  from datmo.config import Config
  from datmo.cli.driver.helper import Helper
  from datmo.cli.command.project import ProjectCommand
  from datmo.cli.command.run import RunCommand
  from datmo.core.entity.run import Run
  from datmo.core.util.exceptions import DoesNotExist, MutuallyExclusiveArguments, RequiredArgumentMissing
  from datmo.core.util.misc_functions import pytest_docker_environment_failed_instantiation
label_desc: Use image node_id 8 for calling the TestRunCommand obj's underlying member method code with example usage: obj.test_run_notebook() without return types