Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
CaosDB Python Integration Tests
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
CaosDB Python Integration Tests
Commits
7a525917
Commit
7a525917
authored
5 years ago
by
Daniel
Browse files
Options
Downloads
Patches
Plain Diff
TEST: Testing file system with empty folder.
parent
b50c3e21
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_file.py
+15
-9
15 additions, 9 deletions
tests/test_file.py
with
15 additions
and
9 deletions
tests/test_file.py
+
15
−
9
View file @
7a525917
...
...
@@ -5,6 +5,8 @@
#
# Copyright (C) 2018 Research Group Biomedical Physics,
# Max-Planck-Institute for Dynamics and Self-Organization Göttingen
# Copyright (C) 2019 IndiScale GmbH (info@indiscale.com)
# Copyright (C) 2019 Daniel Hornung (d.hornung@indiscale.com)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
...
...
@@ -35,7 +37,7 @@ from nose.tools import (assert_equal, assert_false, # @UnresolvedImport
assert_is_not_none
,
assert_raises
,
assert_true
,
nottest
,
with_setup
)
from
caosdb
import
execute_query
,
get_config
,
get_connection
from
caosdb
import
execute_query
,
get_config
,
get_connection
,
Info
from
caosdb.common
import
models
from
caosdb.exceptions
import
EntityError
from
caosdb.utils.checkFileSystemConsistency
import
runCheck
...
...
@@ -50,13 +52,10 @@ def setup():
upload_file
.
write
(
"
hello world
\n
"
)
upload_file
.
close
()
os
.
mkdir
(
"
testfolder
"
)
os
.
mkdir
(
"
testfolder/subfolder
"
)
upload_file
=
open
(
"
testfolder/test1.dat
"
,
"
w
"
)
upload_file
.
write
(
"
hello world
\n
"
)
upload_file
.
close
()
upload_file
=
open
(
"
testfolder/subfolder/test2.dat
"
,
"
w
"
)
upload_file
.
write
(
"
hello world
\n
"
)
upload_file
.
close
()
with
open
(
"
testfolder/test1.dat
"
,
"
w
"
)
as
upload_file
:
upload_file
.
write
(
"
hello world
\n
"
)
with
open
(
"
testfolder/subfolder/test2.dat
"
,
"
w
"
)
as
upload_file
:
upload_file
.
write
(
"
hello world
\n
"
)
def
teardown
():
...
...
@@ -79,7 +78,7 @@ def teardown():
@with_setup
(
setup
,
teardown
)
def
test_file_with_
empty_
space
():
def
test_file_with_space
():
file_
=
models
.
File
(
name
=
"
TestFile
"
,
description
=
"
Testfile Desc
"
,
path
=
"
testfiles/test file with spaces.dat
"
,
...
...
@@ -696,3 +695,10 @@ def test_thumbnails():
# TODO find a better way to check this
assert_equal
(
xml
[
1
][
0
].
get
(
"
thumbnail
"
)[
-
41
:],
"
/Thumbnails/testfiles/thumbnails_test.dat
"
)
@with_setup
(
setup
,
teardown
)
def
test_empty_folder
():
"""
The file system has has problems with empty subfolders.
"""
os
.
mkdir
(
"
testfolder/subfolder
"
)
Info
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment