portfoliome /
foil
| 1 | import unittest |
||
|
0 ignored issues
–
show
|
|||
| 2 | from math import isnan, nan |
||
|
0 ignored issues
–
show
|
|||
| 3 | |||
| 4 | from foil.converters import nan_to_none, none_to_nan |
||
| 5 | |||
| 6 | |||
| 7 | class TestNanConverters(unittest.TestCase): |
||
| 8 | |||
| 9 | def test_nan_to_none(self): |
||
| 10 | self.assertIsNone(nan_to_none(nan)) |
||
| 11 | self.assertEqual(1, nan_to_none(1)) |
||
| 12 | |||
| 13 | def test_none_to_nan(self): |
||
| 14 | self.assertTrue(isnan(none_to_nan(None))) |
||
| 15 | self.assertEqual(1, none_to_nan(1)) |
||
| 16 |
The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.