-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #1 missing last filename character, and adds test
- Loading branch information
Showing
7 changed files
with
40 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
test.unitypackage - Should contain one file named test.txt with the contents "testing" |
Empty file.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
''' | ||
Tests for package extracting | ||
''' | ||
import os | ||
import unittest | ||
import tempfile | ||
|
||
from unitypackage_extractor.extractor import extractPackage | ||
|
||
class TestTestPackageExtract(unittest.TestCase): | ||
''' | ||
Tests the package extracting functionality | ||
''' | ||
def test_packageExtract(self): | ||
'''should be able to extract a simple unity pckage''' | ||
#arrange | ||
with tempfile.TemporaryDirectory() as tmp: | ||
#test.unitypackage - Should contain one file named test.txt with the contents "testing" | ||
|
||
#act | ||
print(f"Extracting to {tmp}...") | ||
extractPackage("./tests/test.unitypackage", outputPath=tmp) | ||
|
||
#assert | ||
self.assertTrue(os.path.isdir(tmp)) | ||
self.assertTrue(os.path.isdir(f"{tmp}/Assets")) | ||
self.assertTrue(os.path.isfile(f"{tmp}/Assets/test.txt")) | ||
self.assertEqual(open(f"{tmp}/Assets/test.txt").read(), "testing") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters