MCPcopy
hub / github.com/burnash/gspread / test_numeric_value

Method test_numeric_value

tests/cell_test.py:59–77  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

57
58 @pytest.mark.vcr()
59 def test_numeric_value(self):
60 numeric_value = 1.0 / 1024
61 # Use a formula here to avoid issues with differing decimal marks:
62 self.sheet.update_acell("A1", "= 1 / 1024")
63 cell = self.sheet.acell("A1")
64 self.assertEqual(cell.numeric_value, numeric_value)
65 self.assertIsInstance(cell.numeric_value, float)
66
67 # test value for popular format with long numbers
68 numeric_value = 2000000.01
69 self.sheet.update_acell("A1", "2,000,000.01")
70 cell = self.sheet.acell("A1")
71 self.assertEqual(cell.numeric_value, numeric_value)
72 self.assertIsInstance(cell.numeric_value, float)
73
74 # test non numeric value
75 self.sheet.update_acell("A1", "Non-numeric value")
76 cell = self.sheet.acell("A1")
77 self.assertEqual(cell.numeric_value, None)
78
79 @pytest.mark.vcr()
80 def test_a1_value(self):

Callers

nothing calls this directly

Calls 2

update_acellMethod · 0.80
acellMethod · 0.80

Tested by

no test coverage detected