<commit_before># -*- coding: utf-8 -*-

import os

from pynes import main
from pynes.tests import FileTestCase
from mock import patch, Mock

import shutil

class CommandLineTest(FileTestCase):

    @patch('pynes.compiler.compile_file')
    def test_asm(self, compiler):
        main("pynes asm fixtures/movingsprite/movingsprite.asm".split())
        compiler.assert_called_once_with(
            'fixtures/movingsprite/movingsprite.asm',
            output=None, path=None)

    @patch('pynes.compiler.compile_file')
    def test_asm_with_output(self, compiler):
        main("pynes asm fixtures/movingsprite/movingsprite.asm --output /tmp/movingsprite.nes".split())
        compiler.assert_called_once_with(
            'fixtures/movingsprite/movingsprite.asm',
            output='/tmp/movingsprite.nes', path=None)

    @patch('pynes.compiler.compile_file')
    def test_asm_with_path(self, compiler):
        main("pynes asm fixtures/movingsprite/movingsprite.asm --path fixtures/movingsprite".split())
        compiler.assert_called_once_with(
            'fixtures/movingsprite/movingsprite.asm',
            output=None, path='fixtures/movingsprite')


    @patch('pynes.composer.compose_file')
    def test_py(self, composer):
        main("pynes py pynes/examples/movingsprite.py".split())
        composer.assert_called_once_with(
            'pynes/examples/movingsprite.py',
            output=None, asm=False, path=None)

    @patch('pynes.composer.compose_file')
    def test_py_with_asm(self, composer):
        main("pynes py pynes/examples/movingsprite.py --asm".split())
        composer.assert_called_once_with(
            'pynes/examples/movingsprite.py',
            output=None, asm=True, path=None)

    @patch('pynes.composer.compose_file')
    def test_py_with_output(self, composer):
        main("pynes py pynes/examples/movingsprite.py --output output.nes".split())
        composer.assert_called_once_with(
            'pynes/examples/movingsprite.py',
            output='output.nes', asm=False, path=None)

    @patch('pynes.composer.compose_file')
    def test_py_with_path(self, composer):
        main("pynes py pynes/examples/movingsprite.py --path fixtures/movingsprite".split())
        composer.assert_called_once_with(
            'pynes/examples/movingsprite.py',
            output=None, path='fixtures/movingsprite', asm=False)

    def test_py_real_build_movingsprite(self):
        args = (
            "pynes py pynes/examples/movingsprite.py "
            "--path fixtures/movingsprite "
            "--output pynes/examples/movingsprite.nes"
            ).split()
        main(args)

    def test_py_real_build_mario(self):
        args = (
            "pynes py pynes/examples/mario.py "
            "--path fixtures/nesasm/scrolling "
            "--output pynes/examples/mario.nes"
            ).split()
        main(args)

    def test_py_real_build_helloworld(self):
        args = (
            "pynes py pynes/examples/helloworld.py "
            "--path fixtures/nesasm/scrolling "
            "--output pynes/examples/helloworld.nes"
            ).split()
        main(args)<commit_msg>fixed some issues for the slide events.<commit_after># -*- coding: utf-8 -*-

import os

from pynes import main
from pynes.tests import FileTestCase
from mock import patch, Mock

import shutil

class CommandLineTest(FileTestCase):

    @patch('pynes.compiler.compile_file')
    def test_asm(self, compiler):
        main("pynes asm fixtures/movingsprite/movingsprite.asm".split())
        compiler.assert_called_once_with(
            'fixtures/movingsprite/movingsprite.asm',
            output=None, path=None)

    @patch('pynes.compiler.compile_file')
    def test_asm_with_output(self, compiler):
        main("pynes asm fixtures/movingsprite/movingsprite.asm --output /tmp/movingsprite.nes".split())
        compiler.assert_called_once_with(
            'fixtures/movingsprite/movingsprite.asm',
            output='/tmp/movingsprite.nes', path=None)

    @patch('pynes.compiler.compile_file')
    def test_asm_with_path(self, compiler):
        main("pynes asm fixtures/movingsprite/movingsprite.asm --path fixtures/movingsprite".split())
        compiler.assert_called_once_with(
            'fixtures/movingsprite/movingsprite.asm',
            output=None, path='fixtures/movingsprite')


    @patch('pynes.composer.compose_file')
    def test_py(self, composer):
        main("pynes py pynes/examples/movingsprite.py".split())
        composer.assert_called_once_with(
            'pynes/examples/movingsprite.py',
            output=None, asm=False, path=None)

    @patch('pynes.composer.compose_file')
    def test_py_with_asm(self, composer):
        main("pynes py pynes/examples/movingsprite.py --asm".split())
        composer.assert_called_once_with(
            'pynes/examples/movingsprite.py',
            output=None, asm=True, path=None)

    @patch('pynes.composer.compose_file')
    def test_py_with_output(self, composer):
        main("pynes py pynes/examples/movingsprite.py --output output.nes".split())
        composer.assert_called_once_with(
            'pynes/examples/movingsprite.py',
            output='output.nes', asm=False, path=None)

    @patch('pynes.composer.compose_file')
    def test_py_with_path(self, composer):
        main("pynes py pynes/examples/movingsprite.py --path fixtures/movingsprite".split())
        composer.assert_called_once_with(
            'pynes/examples/movingsprite.py',
            output=None, path='fixtures/movingsprite', asm=False)

    def test_py_real_build_movingsprite(self):
        args = (
            "pynes py pynes/examples/movingsprite.py "
            "--path fixtures/movingsprite "
            "--output pynes/examples/movingsprite.nes"
            ).split()
        main(args)

    def test_py_real_build_mario(self):
        args = (
            "pynes py pynes/examples/mario.py "
            "--path fixtures/nesasm/scrolling "
            "--output pynes/examples/mario.nes"
            ).split()
        main(args)

    def test_py_real_build_helloworld(self):
        args = (
            "pynes py pynes/examples/helloworld.py "
            "--path fixtures/nesasm/scrolling "
            "--output pynes/examples/helloworld.nes"
            ).split()
        main(args)

    def test_py_real_build_slides(self):
        args = (
            "pynes py pynes/examples/slides.py "
            "--path fixtures/nesasm/scrolling "
            "--output pynes/examples/slides.nes --asm"
            ).split()
        main(args)
{'fraction_non_alphanumeric': 0.11818458726774292, 'fraction_numerical': 0.0003045994517209869, 'mean_word_length': 2.622173193601765, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4915523', 'n_tokens_mistral': 2144, 'n_tokens_neox': 2071, 'n_words': 314}