def test_free_space_returns_cur_size_if_is_limitsizefs(self): # Arrange fs = LimitSizeFS(MemoryFS(), mb(230)) # Act space = free_space(fs) # Assert assert space == mb(230)
def test_free_space_returns_meta_if_has_meta(self): # Arrange fs = MemoryFS() fs.getmeta = Mock(return_value=mb(230)) # Act space = free_space(fs) # Assert assert space == mb(230)
def test_free_space_raises_meta_error_if_no_size_info(self): # Arrange fs = MemoryFS() # Act & Assert with raises(NoMetaError): free_space(fs)