neser 0.1.1

NESER - NES Emulator in Rust - is a NES emulator written in Rust. It aims to be a high-quality, hardware-accurate emulator that is also easy to use and extend. It supports a wide range of NES games and features, including various mappers, audio processing, and input handling. NESER is designed to be modular and extensible, allowing developers to easily add new features or support for additional hardware. It can be run using one of two frontends: a native desktop application using SDL2, or a web application using WebAssembly. The desktop application provides a high-performance, feature-rich experience with support for various input devices and display options, while the web application allows users to play NES games directly in their browsers without needing to install any software in a BYOR manner (Bring Your Own Roms).
Documentation
"""Unit tests for scraper CLI helpers in main.py."""

import unittest

from scripts.scraper.main import _csv_cell, _filter_present_fields


class TestMainHelpers(unittest.TestCase):
    """Tests for row filtering used by list output."""

    def test_filter_present_fields_keeps_zero_and_drops_none(self):
        row = {
            "prg_ram_size": 0,
            "chr_ram_size": None,
            "name": "Example",
        }
        filtered = _filter_present_fields(row)
        self.assertEqual(filtered["prg_ram_size"], 0)
        self.assertNotIn("chr_ram_size", filtered)
        self.assertEqual(filtered["name"], "Example")

    def test_csv_cell_keeps_zero(self):
        self.assertEqual(_csv_cell(0), "0")

    def test_csv_cell_blanks_only_none(self):
        self.assertEqual(_csv_cell(None), "")


if __name__ == "__main__":
    unittest.main()