Python simplejson.decoder.NegInf() Examples

The following are code examples for showing how to use simplejson.decoder.NegInf(). They are from open source Python projects. You can vote up the examples you like or vote down the ones you don't like.

Example 1
Project: FUTU_Stop_Loss   Author: BigtoC   File: test_float.py    MIT License 5 votes vote down vote up
def test_degenerates_allow(self):
        for inf in (PosInf, NegInf):
            self.assertEqual(json.loads(json.dumps(inf)), inf)
        # Python 2.5 doesn't have math.isnan
        nan = json.loads(json.dumps(NaN))
        self.assertTrue((0 + nan) != nan) 
Example 2
Project: FUTU_Stop_Loss   Author: BigtoC   File: test_float.py    MIT License 5 votes vote down vote up
def test_degenerates_ignore(self):
        for f in (PosInf, NegInf, NaN):
            self.assertEqual(json.loads(json.dumps(f, ignore_nan=True)), None) 
Example 3
Project: FUTU_Stop_Loss   Author: BigtoC   File: test_float.py    MIT License 5 votes vote down vote up
def test_degenerates_deny(self):
        for f in (PosInf, NegInf, NaN):
            self.assertRaises(ValueError, json.dumps, f, allow_nan=False) 
Example 4
Project: tra-tracking-on-gae   Author: elliot79313   File: test_float.py    MIT License 5 votes vote down vote up
def test_degenerates_allow(self):
        for inf in (PosInf, NegInf):
            self.assertEqual(json.loads(json.dumps(inf)), inf)
        # Python 2.5 doesn't have math.isnan
        nan = json.loads(json.dumps(NaN))
        self.assertTrue((0 + nan) != nan) 
Example 5
Project: tra-tracking-on-gae   Author: elliot79313   File: test_float.py    MIT License 5 votes vote down vote up
def test_degenerates_ignore(self):
        for f in (PosInf, NegInf, NaN):
            self.assertEqual(json.loads(json.dumps(f, ignore_nan=True)), None) 
Example 6
Project: tra-tracking-on-gae   Author: elliot79313   File: test_float.py    MIT License 5 votes vote down vote up
def test_degenerates_deny(self):
        for f in (PosInf, NegInf, NaN):
            self.assertRaises(ValueError, json.dumps, f, allow_nan=False) 
Example 7
Project: ableton-live-webapi   Author: valsteen   File: test_float.py    The Unlicense 5 votes vote down vote up
def test_degenerates_allow(self):
        for inf in (PosInf, NegInf):
            self.assertEqual(json.loads(json.dumps(inf)), inf)
        # Python 2.5 doesn't have math.isnan
        nan = json.loads(json.dumps(NaN))
        self.assertTrue((0 + nan) != nan) 
Example 8
Project: ableton-live-webapi   Author: valsteen   File: test_float.py    The Unlicense 5 votes vote down vote up
def test_degenerates_ignore(self):
        for f in (PosInf, NegInf, NaN):
            self.assertEqual(json.loads(json.dumps(f, ignore_nan=True)), None) 
Example 9
Project: ableton-live-webapi   Author: valsteen   File: test_float.py    The Unlicense 5 votes vote down vote up
def test_degenerates_deny(self):
        for f in (PosInf, NegInf, NaN):
            self.assertRaises(ValueError, json.dumps, f, allow_nan=False) 
Example 10
Project: fund   Author: Frank-qlu   File: test_float.py    Apache License 2.0 5 votes vote down vote up
def test_degenerates_allow(self):
        for inf in (PosInf, NegInf):
            self.assertEqual(json.loads(json.dumps(inf)), inf)
        # Python 2.5 doesn't have math.isnan
        nan = json.loads(json.dumps(NaN))
        self.assertTrue((0 + nan) != nan) 
Example 11
Project: fund   Author: Frank-qlu   File: test_float.py    Apache License 2.0 5 votes vote down vote up
def test_degenerates_ignore(self):
        for f in (PosInf, NegInf, NaN):
            self.assertEqual(json.loads(json.dumps(f, ignore_nan=True)), None) 
Example 12
Project: fund   Author: Frank-qlu   File: test_float.py    Apache License 2.0 5 votes vote down vote up
def test_degenerates_deny(self):
        for f in (PosInf, NegInf, NaN):
            self.assertRaises(ValueError, json.dumps, f, allow_nan=False) 
Example 13
Project: oscars2016   Author: 0x0ece   File: test_float.py    Apache License 2.0 5 votes vote down vote up
def test_degenerates_allow(self):
        for inf in (PosInf, NegInf):
            self.assertEqual(json.loads(json.dumps(inf)), inf)
        # Python 2.5 doesn't have math.isnan
        nan = json.loads(json.dumps(NaN))
        self.assertTrue((0 + nan) != nan) 
Example 14
Project: oscars2016   Author: 0x0ece   File: test_float.py    Apache License 2.0 5 votes vote down vote up
def test_degenerates_ignore(self):
        for f in (PosInf, NegInf, NaN):
            self.assertEqual(json.loads(json.dumps(f, ignore_nan=True)), None) 
Example 15
Project: oscars2016   Author: 0x0ece   File: test_float.py    Apache License 2.0 5 votes vote down vote up
def test_degenerates_deny(self):
        for f in (PosInf, NegInf, NaN):
            self.assertRaises(ValueError, json.dumps, f, allow_nan=False) 
Example 16
Project: that-startpage-rocks   Author: the-duck   File: test_float.py    GNU Lesser General Public License v3.0 5 votes vote down vote up
def test_degenerates_allow(self):
        for inf in (PosInf, NegInf):
            self.assertEqual(json.loads(json.dumps(inf)), inf)
        # Python 2.5 doesn't have math.isnan
        nan = json.loads(json.dumps(NaN))
        self.assertTrue((0 + nan) != nan) 
Example 17
Project: that-startpage-rocks   Author: the-duck   File: test_float.py    GNU Lesser General Public License v3.0 5 votes vote down vote up
def test_degenerates_ignore(self):
        for f in (PosInf, NegInf, NaN):
            self.assertEqual(json.loads(json.dumps(f, ignore_nan=True)), None) 
Example 18
Project: that-startpage-rocks   Author: the-duck   File: test_float.py    GNU Lesser General Public License v3.0 5 votes vote down vote up
def test_degenerates_deny(self):
        for f in (PosInf, NegInf, NaN):
            self.assertRaises(ValueError, json.dumps, f, allow_nan=False) 
Example 19
Project: cohesive-networks-vns3-vpn-monitoring   Author: trek10inc   File: test_float.py    MIT License 5 votes vote down vote up
def test_degenerates_allow(self):
        for inf in (PosInf, NegInf):
            self.assertEqual(json.loads(json.dumps(inf)), inf)
        # Python 2.5 doesn't have math.isnan
        nan = json.loads(json.dumps(NaN))
        self.assertTrue((0 + nan) != nan) 
Example 20
Project: cohesive-networks-vns3-vpn-monitoring   Author: trek10inc   File: test_float.py    MIT License 5 votes vote down vote up
def test_degenerates_ignore(self):
        for f in (PosInf, NegInf, NaN):
            self.assertEqual(json.loads(json.dumps(f, ignore_nan=True)), None) 
Example 21
Project: cohesive-networks-vns3-vpn-monitoring   Author: trek10inc   File: test_float.py    MIT License 5 votes vote down vote up
def test_degenerates_deny(self):
        for f in (PosInf, NegInf, NaN):
            self.assertRaises(ValueError, json.dumps, f, allow_nan=False) 
Example 22
Project: alfredToday   Author: jeeftor   File: test_float.py    MIT License 5 votes vote down vote up
def test_degenerates_allow(self):
        for inf in (PosInf, NegInf):
            self.assertEqual(json.loads(json.dumps(inf)), inf)
        # Python 2.5 doesn't have math.isnan
        nan = json.loads(json.dumps(NaN))
        self.assertTrue((0 + nan) != nan) 
Example 23
Project: alfredToday   Author: jeeftor   File: test_float.py    MIT License 5 votes vote down vote up
def test_degenerates_ignore(self):
        for f in (PosInf, NegInf, NaN):
            self.assertEqual(json.loads(json.dumps(f, ignore_nan=True)), None) 
Example 24
Project: alfredToday   Author: jeeftor   File: test_float.py    MIT License 5 votes vote down vote up
def test_degenerates_deny(self):
        for f in (PosInf, NegInf, NaN):
            self.assertRaises(ValueError, json.dumps, f, allow_nan=False) 
Example 25
Project: old-dotfiles   Author: hawkw   File: test_float.py    MIT License 5 votes vote down vote up
def test_degenerates_allow(self):
        for inf in (PosInf, NegInf):
            self.assertEqual(json.loads(json.dumps(inf)), inf)
        # Python 2.5 doesn't have math.isnan
        nan = json.loads(json.dumps(NaN))
        self.assertTrue((0 + nan) != nan) 
Example 26
Project: old-dotfiles   Author: hawkw   File: test_float.py    MIT License 5 votes vote down vote up
def test_degenerates_ignore(self):
        for f in (PosInf, NegInf, NaN):
            self.assertEqual(json.loads(json.dumps(f, ignore_nan=True)), None) 
Example 27
Project: old-dotfiles   Author: hawkw   File: test_float.py    MIT License 5 votes vote down vote up
def test_degenerates_deny(self):
        for f in (PosInf, NegInf, NaN):
            self.assertRaises(ValueError, json.dumps, f, allow_nan=False) 
Example 28
Project: pureapp   Author: samisalkosuo   File: test_float.py    Apache License 2.0 5 votes vote down vote up
def test_degenerates_allow(self):
        for inf in (PosInf, NegInf):
            self.assertEqual(json.loads(json.dumps(inf)), inf)
        # Python 2.5 doesn't have math.isnan
        nan = json.loads(json.dumps(NaN))
        self.assertTrue((0 + nan) != nan) 
Example 29
Project: pureapp   Author: samisalkosuo   File: test_float.py    Apache License 2.0 5 votes vote down vote up
def test_degenerates_ignore(self):
        for f in (PosInf, NegInf, NaN):
            self.assertEqual(json.loads(json.dumps(f, ignore_nan=True)), None) 
Example 30
Project: pureapp   Author: samisalkosuo   File: test_float.py    Apache License 2.0 5 votes vote down vote up
def test_degenerates_deny(self):
        for f in (PosInf, NegInf, NaN):
            self.assertRaises(ValueError, json.dumps, f, allow_nan=False) 
Example 31
Project: pureapp   Author: samisalkosuo   File: test_float.py    Apache License 2.0 5 votes vote down vote up
def test_degenerates_allow(self):
        for inf in (PosInf, NegInf):
            self.assertEqual(json.loads(json.dumps(inf)), inf)
        # Python 2.5 doesn't have math.isnan
        nan = json.loads(json.dumps(NaN))
        self.assertTrue((0 + nan) != nan) 
Example 32
Project: pureapp   Author: samisalkosuo   File: test_float.py    Apache License 2.0 5 votes vote down vote up
def test_degenerates_ignore(self):
        for f in (PosInf, NegInf, NaN):
            self.assertEqual(json.loads(json.dumps(f, ignore_nan=True)), None) 
Example 33
Project: syntheticmass   Author: synthetichealth   File: test_float.py    Apache License 2.0 5 votes vote down vote up
def test_degenerates_allow(self):
        for inf in (PosInf, NegInf):
            self.assertEqual(json.loads(json.dumps(inf)), inf)
        # Python 2.5 doesn't have math.isnan
        nan = json.loads(json.dumps(NaN))
        self.assertTrue((0 + nan) != nan) 
Example 34
Project: syntheticmass   Author: synthetichealth   File: test_float.py    Apache License 2.0 5 votes vote down vote up
def test_degenerates_ignore(self):
        for f in (PosInf, NegInf, NaN):
            self.assertEqual(json.loads(json.dumps(f, ignore_nan=True)), None) 
Example 35
Project: syntheticmass   Author: synthetichealth   File: test_float.py    Apache License 2.0 5 votes vote down vote up
def test_degenerates_deny(self):
        for f in (PosInf, NegInf, NaN):
            self.assertRaises(ValueError, json.dumps, f, allow_nan=False)