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

import unittest
from pycmbs import netcdf

class TestPycmbsNetcdf(unittest.TestCase):

    def setUp(self):
        pass

    def test_netCDFHandlerinit_WithInvalidValue(self):
        with self.assertRaises(ValueError):
            cdf = netcdf.NetCDFHandler(netcdf_backend='invalid_backend')

    def test_netCDF_openFile_InvalidMode(self):
        with self.assertRaises(ValueError):
            cdf = netcdf.NetCDFHandler()
            cdf.open_file('nix.nc', 'xxx')

    def test_netCDF_openFile_InvalidFile(self):
        with self.assertRaises(ValueError):
            cdf = netcdf.NetCDFHandler()
            cdf.open_file('nopefile.nc', 'r')

    def test_netCDFHandlerinit_Default(self):
        cdf = netcdf.NetCDFHandler()

    def test_netCDFHandlerinit_Nio(self):
        cdf = netcdf.NetCDFHandler(netcdf_backend='Nio')
        self.assertEqual(cdf.type, 'Nio')  # could be that this fails if Nio not existing!
        cdf = netcdf.NetCDFHandler(netcdf_backend='nio')
        self.assertEqual(cdf.type, 'nio')

    def test_DummyTest(self):
        pass

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

# vim: expandtab shiftwidth=4 softtabstop=4<commit_msg>[tests/netcdf] skipping tests with Nio<commit_after># -*- coding: utf-8 -*-

import unittest
from pycmbs import netcdf

class TestPycmbsNetcdf(unittest.TestCase):

    def setUp(self):
        pass

    def test_netCDFHandlerinit_WithInvalidValue(self):
        with self.assertRaises(ValueError):
            cdf = netcdf.NetCDFHandler(netcdf_backend='invalid_backend')

    def test_netCDF_openFile_InvalidMode(self):
        with self.assertRaises(ValueError):
            cdf = netcdf.NetCDFHandler()
            cdf.open_file('nix.nc', 'xxx')

    def test_netCDF_openFile_InvalidFile(self):
        with self.assertRaises(ValueError):
            cdf = netcdf.NetCDFHandler()
            cdf.open_file('nopefile.nc', 'r')

    def test_netCDFHandlerinit_Default(self):
        cdf = netcdf.NetCDFHandler()

    @unittest.skip('Nio will be deprecated')
    def test_netCDFHandlerinit_Nio(self):
        cdf = netcdf.NetCDFHandler(netcdf_backend='Nio')
        self.assertEqual(cdf.type, 'Nio')  # could be that this fails if Nio not existing!
        cdf = netcdf.NetCDFHandler(netcdf_backend='nio')
        self.assertEqual(cdf.type, 'nio')

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

# vim: expandtab shiftwidth=4 softtabstop=4
{'fraction_non_alphanumeric': 0.1068515497553018, 'fraction_numerical': 0.0024469820554649264, 'mean_word_length': 3.266086956521739, 'pattern_counts': {'":': 2, '<': 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': '1434064', 'n_tokens_mistral': 855, 'n_tokens_neox': 834, 'n_words': 144}