def test_valid_remove(self): changes = [dict(count=10, pos=0, type=-1)] self.assertTrue(IDEController.is_valid_changes(changes))
def test_bad_pos_value(self): changes = [dict(content='abc', pos=-13, type=1)] self.assertFalse(IDEController.is_valid_changes(changes))
def test_valid_add_unicode(self): changes = [dict(content=u'abc', pos=0, type=1)] self.assertTrue(IDEController.is_valid_changes(changes))
def test_bad_type_type(self): changes = [dict(content='abc', pos=0, type=str(10))] self.assertFalse(IDEController.is_valid_changes(changes))
def test_missing_pos_key(self): changes = [dict(content='abc', type=1)] self.assertFalse(IDEController.is_valid_changes(changes))
def test_bad_content_type(self): changes = [dict(content=0, pos=0, type=1)] self.assertFalse(IDEController.is_valid_changes(changes))
def test_bad_count_value(self): changes = [dict(count=-1, pos=0, type=-1)] self.assertFalse(IDEController.is_valid_changes(changes))
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))
def test_missing_content_count_keys(self): changes = [dict(pos=0, type=str(10))] self.assertFalse(IDEController.is_valid_changes(changes))
def test_bad_element_type(self): changes = [['abc', 1, 0]] self.assertFalse(IDEController.is_valid_changes(changes))
def test_bad_type(self): changes = 0 self.assertFalse(IDEController.is_valid_changes(changes))
def test_empty_array(self): changes = [] self.assertTrue(IDEController.is_valid_changes(changes))