def test_rm_file_not_existing_file(): """Remove file from dataset""" info = {'id': '1', 'path': 'test.txt', 'type': 'txt', 'view': 'text'} # Disable warning about * magic # pylint: disable=W0142 dataset = Dataset(**info) # pylint: enable=W0142 assert len(dataset) == 1 dataset.rm_file(path='test.pdf') assert len(dataset) == 1
def test_rm_file_not_existing_file(): """Remove file from dataset""" info = {'id': '1', 'path': 'test.txt', 'type': 'txt', 'view': 'text'} # Disable warning about * magic # pylint: disable=W0142 dataset = Dataset(**info) # pylint: enable=W0142 assert len(dataset) == 1 dataset.rm_file(path='test.pdf') assert len(dataset) == 1
def test_rm_file(): """Remove file from dataset""" info = {'id': '1', 'path': 'test.txt', 'type': 'txt', 'view': 'text'} # Disable warning about * magic # pylint: disable=W0142 dataset = Dataset(**info) # pylint: enable=W0142 dataset.add_file(path='test1.txt', type='txt', view='text') dataset.rm_file(path='test.txt') assert len(dataset) == 1 assert dataset['test.txt'] is None
def test_rm_file(): """Remove file from dataset""" info = {'id': '1', 'path': 'test.txt', 'type': 'txt', 'view': 'text'} # Disable warning about * magic # pylint: disable=W0142 dataset = Dataset(**info) # pylint: enable=W0142 dataset.add_file(path='test1.txt', type='txt', view='text') dataset.rm_file(path='test.txt') assert len(dataset) == 1 assert dataset['test.txt'] is None
def test_rm_last_file(): """Remove file from dataset""" info = {'id': '1', 'path': 'test.txt', 'type': 'txt', 'view': 'text'} # Disable warning about * magic # pylint: disable=W0142 dataset = Dataset(**info) # pylint: enable=W0142 dataset.rm_file(path='test.txt') # Disable warning about: # - missing pytest.raises. # - statement with no effect # pylint: disable=E1101,W0104 with pytest.raises(AttributeError): dataset.txt # pylint: enable=E1101,W0104 assert len(dataset) == 0
def test_rm_last_file(): """Remove file from dataset""" info = {'id': '1', 'path': 'test.txt', 'type': 'txt', 'view': 'text'} # Disable warning about * magic # pylint: disable=W0142 dataset = Dataset(**info) # pylint: enable=W0142 dataset.rm_file(path='test.txt') # Disable warning about: # - missing pytest.raises. # - statement with no effect # pylint: disable=E1101,W0104 with pytest.raises(AttributeError): dataset.txt # pylint: enable=E1101,W0104 assert len(dataset) == 0