TestNanConverters.test_none_to_nan()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
1
import unittest
0 ignored issues
show
Coding Style introduced by
This module should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
2
from math import isnan, nan
0 ignored issues
show
Bug introduced by
The name nan does not seem to exist in module math.
Loading history...
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