Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
snipper
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
tuhe
snipper
Commits
23f6aadb
Commit
23f6aadb
authored
1 year ago
by
tuhe
Browse files
Options
Downloads
Patches
Plain Diff
Fixed test suite
parent
bfd6aefe
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
tests/_trial_temp/_trial_marker
+0
-0
0 additions, 0 deletions
tests/_trial_temp/_trial_marker
tests/setup_test_files.py
+1
-1
1 addition, 1 deletion
tests/setup_test_files.py
tests/test_python.py
+9
-6
9 additions, 6 deletions
tests/test_python.py
with
10 additions
and
7 deletions
tests/_trial_temp/_trial_marker
0 → 100755
+
0
−
0
View file @
23f6aadb
This diff is collapsed.
Click to expand it.
tests/setup_test_files.py
+
1
−
1
View file @
23f6aadb
...
@@ -25,7 +25,7 @@ def setup_keep(source, dest):
...
@@ -25,7 +25,7 @@ def setup_keep(source, dest):
if
__name__
==
"
__main__
"
:
if
__name__
==
"
__main__
"
:
print
(
"
File used for setting up sets -- don
'
t run this script unless repository known to work (Tue, 2022)
"
)
print
(
"
File used for setting up sets -- don
'
t run this script unless repository known to work (Tue, 2022)
"
)
assert
False
#
assert False
# if os.path.isdir("student_repo"):
# if os.path.isdir("student_repo"):
# shutil.rmtree("student_repo")
# shutil.rmtree("student_repo")
...
...
This diff is collapsed.
Click to expand it.
tests/test_python.py
+
9
−
6
View file @
23f6aadb
...
@@ -30,21 +30,24 @@ def is_same(dir1, dir2):
...
@@ -30,21 +30,24 @@ def is_same(dir1, dir2):
return
False
return
False
return
True
return
True
dir
=
os
.
path
.
dirname
(
__file__
)
class
TestPython
(
TestCase
):
class
TestPython
(
TestCase
):
def
test_demo1
(
self
):
def
test_demo1
(
self
):
from
setup_test_files
import
setup
,
setup_keep
from
setup_test_files
import
setup
,
setup_keep
setup
(
"
demo1
"
,
"
demo1_tmp
"
)
setup
(
dir
+
"
/
demo1
"
,
dir
+
"
/
demo1_tmp
"
)
report
=
filecmp
.
dircmp
(
"
demo1_correct
"
,
"
demo1_tmp
"
)
report
=
filecmp
.
dircmp
(
dir
+
"
/
demo1_correct
"
,
dir
+
"
/
demo1_tmp
"
)
print
(
"
Different
"
,
report
.
report
())
print
(
"
Different
"
,
report
.
report
())
self
.
assertTrue
(
is_same
(
"
demo1_correct
"
,
"
demo1_tmp
"
))
self
.
assertTrue
(
is_same
(
dir
+
"
/
demo1_correct
"
,
dir
+
"
/
demo1_tmp
"
))
def
test_demo2
(
self
):
def
test_demo2
(
self
):
from
setup_test_files
import
setup
,
setup_keep
from
setup_test_files
import
setup
,
setup_keep
setup_keep
(
"
demo2/framework.py
"
,
"
demo2/framework_tmp.txt
"
)
setup_keep
(
dir
+
"
/
demo2/framework.py
"
,
dir
+
"
/
demo2/framework_tmp.txt
"
)
with
open
(
"
demo2/framework_tmp.txt
"
)
as
f
:
with
open
(
dir
+
"
/
demo2/framework_tmp.txt
"
)
as
f
:
tmp
=
f
.
read
()
tmp
=
f
.
read
()
with
open
(
"
demo2/framework_correct.txt
"
)
as
f
:
with
open
(
dir
+
"
/
demo2/framework_correct.txt
"
)
as
f
:
correct
=
f
.
read
()
correct
=
f
.
read
()
self
.
assertEqual
(
tmp
,
correct
)
self
.
assertEqual
(
tmp
,
correct
)
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