Exemplo n.º 1
0
 def test_valid_remove(self):
     changes = [dict(count=10, pos=0, type=-1)]
     self.assertTrue(IDEController.is_valid_changes(changes))
Exemplo n.º 2
0
 def test_bad_pos_value(self):
     changes = [dict(content='abc', pos=-13, type=1)]
     self.assertFalse(IDEController.is_valid_changes(changes))
Exemplo n.º 3
0
 def test_valid_add_unicode(self):
     changes = [dict(content=u'abc', pos=0, type=1)]
     self.assertTrue(IDEController.is_valid_changes(changes))
Exemplo n.º 4
0
 def test_bad_type_type(self):
     changes = [dict(content='abc', pos=0, type=str(10))]
     self.assertFalse(IDEController.is_valid_changes(changes))
Exemplo n.º 5
0
 def test_missing_pos_key(self):
     changes = [dict(content='abc', type=1)]
     self.assertFalse(IDEController.is_valid_changes(changes))
Exemplo n.º 6
0
 def test_bad_content_type(self):
     changes = [dict(content=0, pos=0, type=1)]
     self.assertFalse(IDEController.is_valid_changes(changes))
Exemplo n.º 7
0
 def test_bad_count_value(self):
     changes = [dict(count=-1, pos=0, type=-1)]
     self.assertFalse(IDEController.is_valid_changes(changes))
Exemplo n.º 8
0
 def test_both_content_count_keys_2(self):
     changes = [dict(content='abc', count=1, pos=0, type=-1)]
     self.assertFalse(IDEController.is_valid_changes(changes))
Exemplo n.º 9
0
 def test_missing_content_count_keys(self):
     changes = [dict(pos=0, type=str(10))]
     self.assertFalse(IDEController.is_valid_changes(changes))
Exemplo n.º 10
0
 def test_bad_element_type(self):
     changes = [['abc', 1, 0]]
     self.assertFalse(IDEController.is_valid_changes(changes))
Exemplo n.º 11
0
 def test_bad_type(self):
     changes = 0
     self.assertFalse(IDEController.is_valid_changes(changes))
Exemplo n.º 12
0
 def test_empty_array(self):
     changes = []
     self.assertTrue(IDEController.is_valid_changes(changes))