Esempio n. 1
0
 def test_safeSum_list_with_nan(self):
     self.assertAlmostEqual(glyph.safeSum([1, 5.1, 6,
                                           float('Nan')]),
                            12.1,
                            places=4)
Esempio n. 2
0
 def test_safeSum_list_with_string(self):
     with self.assertRaises(TypeError):
         glyph.safeSum(['a', 10, 30])
Esempio n. 3
0
 def test_safeSum_list_all_numbers(self):
     self.assertAlmostEqual(glyph.safeSum([
         1,
         5.1,
         6,
     ]), 12.1, places=4)
Esempio n. 4
0
 def test_safeSum_number_not_list(self):
     with self.assertRaises(TypeError):
         glyph.safeSum(1)
Esempio n. 5
0
 def test_safeSum_empty_string(self):
     self.assertEqual(glyph.safeSum(''), 0)
 def test_safeSum_list_with_nan(self):
   self.assertAlmostEqual(glyph.safeSum([1,5.1,6,float('Nan')]), 12.1, places=4)
Esempio n. 7
0
 def test_safeSum_None(self):
     with self.assertRaises(TypeError):
         glyph.safeSum(None)
 def test_safeSum_list_all_numbers(self):
   self.assertAlmostEqual(glyph.safeSum([1,5.1,6,]), 12.1, places=4)
 def test_safeSum_list_with_string(self):
   with self.assertRaises(TypeError):
     glyph.safeSum(['a',10,30])
Esempio n. 10
0
 def test_safeSum_empty_string(self):
   self.assertEqual(glyph.safeSum(''), 0)
Esempio n. 11
0
 def test_safeSum_number_not_list(self):
   with self.assertRaises(TypeError):
     glyph.safeSum(1)
Esempio n. 12
0
 def test_safeSum_None(self):
   with self.assertRaises(TypeError):
     glyph.safeSum(None)