Example #1
0
    def test_current_to_previous(self):

        current = ('1', '2', '3')
        manager = TODOManager(current)
        assert manager.previous != manager.current

        new_data = ('4', '5', '6')
        manager.reload(new_data)
        assert manager.previous == current
Example #2
0
 def _datadriven_assert(self, current, new_data, should):
     manager = TODOManager(current)
     manager.reload(new_data)
     if should == "not change":
         assert not manager.has_change
     elif should == "has change":
         assert manager.has_change
     else:
         assert not "has argument error "
Example #3
0
    def test_check_modify(self):
        current = ['1', '2', '3']
        manager = TODOManager(current)
        manager.reload(current)
        assert manager.previous == manager.current
        assert not manager.has_change

        new_data = ['1', '3']
        manager.reload(new_data)
        assert manager.has_change
Example #4
0
 def test_get_delete_row(self):
     current = ['1', '2', '3']
     manager = TODOManager(current)
     new_data = ['1', '3']
     manager.reload(new_data)
     assert manager.deleted == ['2']