Ejemplo n.º 1
0
 def test_upload_after_delete(self):
     ap = ActionPlan()
     ap.add_delete('test')
     ap.add_upload('test', 'path')
     assert len(list(ap.affected_keys)) == 1
     assert len(list(ap.to_delete)) == 0
     assert len(list(ap.to_upload)) == 1
Ejemplo n.º 2
0
 def test_delete(self):
     ap = ActionPlan()
     ap.add_delete('test1')
     ap.add_delete('test2')
     ap.add_delete('test1')
     r = list(ap.to_delete)
     assert len(r) == 2
     assert 'test1' in r
     assert 'test2' in r
Ejemplo n.º 3
0
 def test_merge(self):
     ap1 = ActionPlan()
     ap2 = ActionPlan()
     ap1.add_delete('test1')
     ap2.add_upload('test2', 'path')
     ap3 = ap1 + ap2
     assert len(list(ap3.affected_keys)) == 2
     assert len(list(ap3.to_upload)) == 1
     assert len(list(ap3.to_delete)) == 1
Ejemplo n.º 4
0
 def test_merge_conflict(self):
     ap1 = ActionPlan()
     ap2 = ActionPlan()
     ap1.add_redirect('test1', 'url')
     ap2.add_upload('test1', 'path')
     ap1 + ap2
Ejemplo n.º 5
0
 def test_action_plan_upload_after_upload_different(self):
     ap = ActionPlan()
     ap.add_upload('test', 'path')
     ap.add_upload('test', 'different_path')