Skip to content

Commit

Permalink
STCC-181 reimplement failing tests in test converter (#125)
Browse files Browse the repository at this point in the history
  • Loading branch information
sandra0521 authored and AntiDog committed May 6, 2019
1 parent c8d2750 commit 486aee6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
2 changes: 1 addition & 1 deletion config/default.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: Scratch2Catrobat Converter
short_name: S2CC
version: 0.10.0
build_name: Aegean cat
build_number: 985
build_number: 989

;-------------------------------------------------------------------------------
[CATROBAT]
Expand Down
24 changes: 10 additions & 14 deletions src/scratchtocatrobat/converter/test_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -2578,18 +2578,14 @@ def test_key_pressed_script(self):


class TestConvertProjects(common_testing.ProjectTestCase):
def _load_test_scratch_project(self, project_name):
if os.path.splitext(project_name)[1]:
tempdir = common.TemporaryDirectory()
scratch_project_dir = tempdir.name
self.addCleanup(tempdir.cleanup)
common.extract(common_testing.get_test_project_packed_file(project_name),
scratch_project_dir)
else:
scratch_project_dir = common_testing.get_test_project_path(project_name)
def _load_test_scratch_project(self, project_name, force_download=False):
if (not force_download and os.path.exists("test/res/scratch/"+project_name)):
is_local_project = True

scratch_project_dir = common_testing.get_test_project_path(project_name)

scratch_project = scratch.Project(scratch_project_dir, name=project_name,
project_id=common_testing.PROJECT_DUMMY_ID)
project_id=common_testing.PROJECT_DUMMY_ID, is_local_project=is_local_project)
return scratch_project

def _test_project(self, project_name):
Expand Down Expand Up @@ -2628,16 +2624,16 @@ def test_can_convert_visible_variables(self):
assert found_show_var

# full_test_no_var
#def test_can_convert_project_without_variables(self):
# self._test_project("full_test_no_var")
def test_can_convert_project_without_variables(self):
self._test_project("full_test_no_var")

# keys_pressed
def test_can_convert_project_with_keys(self):
for project_name in ("keys_pressed", ):
self._test_project(project_name)

#def test_can_convert_project_with_mediafiles(self):
# self._test_project("Hannah_Montana")
def test_can_convert_project_with_mediafiles(self):
self._test_project("Hannah_Montana")

# simple test project
def test_can_convert_project_with_unusued_files(self):
Expand Down

0 comments on commit 486aee6

Please # to comment.