def setUp(self):
   rs.DeleteDocumentData()
   # there's no DeleteDocumentUserText()
   keys = rs.GetDocumentUserText()
   if keys:
     for k in keys:
       rs.SetDocumentUserText(k)
def test_set_value():
    dict_names = rs.GetDocumentData()
    counters_exists = 'counters' in dict_names
    if counters_exists:
        rs.DeleteDocumentData('counters')

    def try_good_args():
        d.Dictionary.purge_dicts()
        good_value_set = c.Counter.set_value('shapes', 0)
        if not good_value_set == 0:
            print("good_value_set: expected 0; got %s" % good_value_set)

    def try_bad_arg_neg_int_value():
        neg_int_value_set = c.Counter.set_value('shapes', -3)
        if not neg_int_value_set == None:
            print("neg_int_value_set: expected None; got %s" %
                  (neg_int_value_set))

    def try_bad_arg_float_value():
        float_value_set = c.Counter.set_value('shapes', 3.7)
        if not float_value_set == None:
            print("float_value_set: expected None; got %s" % float_value_set)

    def try_bad_arg_str_value():
        str_value_set = c.Counter.set_value('shapes', 'zero')
        if not str_value_set == None:
            print("str_value_set: expected None; got %s" % str_value_set)

    try_good_args()
    try_bad_arg_neg_int_value()
    try_bad_arg_float_value()
    try_bad_arg_str_value()
 def test_DeleteDocumentData_not_delete_DocumentUserText(self):
     s, e, v = sec_ent_val()
     rs.SetDocumentData(s, e, v)
     _, k, v = sec_ent_val()
     rs.SetDocumentUserText(k, v)
     rs.DeleteDocumentData()
     self.assertEqual(v, rs.GetDocumentUserText(k))
Exemplo n.º 4
0
 def _clear_data(cls):
     rs.DeleteDocumentData()
Exemplo n.º 5
0
def delete_document_data():
    rs.DeleteDocumentData()
    document_data = rs.GetDocumentData()
    print('document data before: %s' % document_data)