Beispiel #1
0
 def test_load_initial_savepoint(self):
     sess = mock.MagicMock()
     ds = Dataset(session=sess)
     ds.savepoints = mock.MagicMock()
     ds.savepoints.index = {
         1: {
             'description': 'savepoint description'
         }
     }
     with pytest.raises(KeyError) as err:
         ds.create_savepoint('savepoint description')
Beispiel #2
0
 def test_create_savepoint(self):
     sess = mock.MagicMock()
     ds = Dataset(session=sess)
     ds.savepoints = mock.MagicMock()
     ds.create_savepoint('savepoint description')
     ds.savepoints.create.assert_called_with(
         {
             'body': {
                 'description': 'savepoint description'
             }
         }
     )