Esempio n. 1
0
 def test_v0_happy(self):
     result = editcells.migrate_params(
         {"celledits": '[{"row": 1, "col": "A", "value": "V"}]'})
     self.assertEqual(result,
                      {"celledits": [{
                          "row": 1,
                          "col": "A",
                          "value": "V"
                      }]})
Esempio n. 2
0
 def test_v0_int_value(self):
     # [adamhooper, 2019-03-13] I scoured our git logs for any hint of
     # String-to-Number conversions when setting value; I found nothing. Yet
     # there are surely v0 params in the database that have numeric "value".
     # So let's just convert them all to String here.
     #
     # We assume v1 has no Number values.
     result = editcells.migrate_params(
         {"celledits": '[{"row": 1, "col": "A", "value": 20}]'}
     )
     self.assertEqual(result, {"celledits": [{"row": 1, "col": "A", "value": "20"}]})
Esempio n. 3
0
 def test_v1_no_op(self):
     expected = {"celledits": [{"row": 1, "col": "A", "value": "V"}]}
     result = editcells.migrate_params(expected)
     self.assertEqual(result, expected)
Esempio n. 4
0
 def test_v0_empty(self):
     result = editcells.migrate_params({"celledits": ""})
     self.assertEqual(result, {"celledits": []})