
from metakernel.tests.utils import (get_kernel, get_log_text, 
                                    clear_log_text, EvalKernel)

def test_edit_magic():
    kernel = get_kernel(EvalKernel)
    results = kernel.do_execute("%edit LICENSE.txt")
    text = results["payload"][0]["text"]
    assert '%%file LICENSE.txt\n\n# Copyright (c) Ipython Kernel Development Team.\n# Distributed under the terms of the Modified BSD License.\n\n\n# Copyright (c) Metakernel Development Team.\n# Distributed under the terms of the Modified BSD License.\n\n' == text, text



from metakernel.tests.utils import (get_kernel, get_log_text, 
                                    clear_log_text, EvalKernel)

def test_edit_magic():
    kernel = get_kernel(EvalKernel)

    results = kernel.do_execute("%%edit %s" % __file__)
    text = results["payload"][0]["text"]
    assert text.startswith('%%file')
    assert 'def test_edit_magic' in text

Fix test edit magic test
Fix test edit magic test

  
  from metakernel.tests.utils import (get_kernel, get_log_text, 
                                      clear_log_text, EvalKernel)
  
  def test_edit_magic():
      kernel = get_kernel(EvalKernel)
+ 
-     results = kernel.do_execute("%edit LICENSE.txt")
+     results = kernel.do_execute("%%edit %s" % __file__)
      text = results["payload"][0]["text"]
-     assert '%%file LICENSE.txt\n\n# Copyright (c) Ipython Kernel Development Team.\n# Distributed under the terms of the Modified BSD License.\n\n\n# Copyright (c) Metakernel Development Team.\n# Distributed under the terms of the Modified BSD License.\n\n' == text, text
+     assert text.startswith('%%file')
+     assert 'def test_edit_magic' in text
  
- 
Fix test edit magic test
## Code Before:

from metakernel.tests.utils import (get_kernel, get_log_text, 
                                    clear_log_text, EvalKernel)

def test_edit_magic():
    kernel = get_kernel(EvalKernel)
    results = kernel.do_execute("%edit LICENSE.txt")
    text = results["payload"][0]["text"]
    assert '%%file LICENSE.txt\n\n# Copyright (c) Ipython Kernel Development Team.\n# Distributed under the terms of the Modified BSD License.\n\n\n# Copyright (c) Metakernel Development Team.\n# Distributed under the terms of the Modified BSD License.\n\n' == text, text


## Instruction:
Fix test edit magic test
## Code After:

from metakernel.tests.utils import (get_kernel, get_log_text, 
                                    clear_log_text, EvalKernel)

def test_edit_magic():
    kernel = get_kernel(EvalKernel)

    results = kernel.do_execute("%%edit %s" % __file__)
    text = results["payload"][0]["text"]
    assert text.startswith('%%file')
    assert 'def test_edit_magic' in text
