Unit tests for the DownloadUpdateTask class

This commit is contained in:
Jan Dalheimer
2013-12-15 12:18:42 +01:00
parent f273334212
commit 3e8bcc1cf6
14 changed files with 325 additions and 59 deletions

43
tests/data/1.json Normal file
View File

@ -0,0 +1,43 @@
{
"ApiVersion": 0,
"Id": 1,
"Name": "1.0.1",
"Files": [
{
"Path": "fileOne",
"Sources": [
{
"SourceType": "http",
"Url": "file://$PWD/tests/data/fileOneA"
}
],
"Executable": true,
"Perms": 493,
"MD5": "9eb84090956c484e32cb6c08455a667b"
},
{
"Path": "fileTwo",
"Sources": [
{
"SourceType": "http",
"Url": "file://$PWD/tests/data/fileTwo"
}
],
"Executable": false,
"Perms": 644,
"MD5": "38f94f54fa3eb72b0ea836538c10b043"
},
{
"Path": "fileThree",
"Sources": [
{
"SourceType": "http",
"Url": "file://$PWD/tests/data/fileThree"
}
],
"Executable": false,
"Perms": "750",
"MD5": "f12df554b21e320be6471d7154130e70"
}
]
}

31
tests/data/2.json Normal file
View File

@ -0,0 +1,31 @@
{
"ApiVersion": 0,
"Id": 1,
"Name": "1.0.1",
"Files": [
{
"Path": "fileOne",
"Sources": [
{
"SourceType": "http",
"Url": "file://$PWD/tests/data/fileOneB"
}
],
"Executable": true,
"Perms": 493,
"MD5": "42915a71277c9016668cce7b82c6b577"
},
{
"Path": "fileTwo",
"Sources": [
{
"SourceType": "http",
"Url": "file://$PWD/tests/data/fileTwo"
}
],
"Executable": false,
"Perms": 644,
"MD5": "38f94f54fa3eb72b0ea836538c10b043"
}
]
}

View File

@ -5,7 +5,7 @@
"id": "develop",
"name": "Develop",
"description": "The channel called \"develop\"",
"url": "http://example.org/stuff"
"url": "file://$PWD/tests/data/"
},
{
"id": "stable",

1
tests/data/fileOneA Normal file
View File

@ -0,0 +1 @@
stuff

3
tests/data/fileOneB Normal file
View File

@ -0,0 +1,3 @@
stuff
more stuff that came in the new version

1
tests/data/fileThree Normal file
View File

@ -0,0 +1 @@
this is yet another file

1
tests/data/fileTwo Normal file
View File

@ -0,0 +1 @@
some other stuff

View File

@ -0,0 +1,17 @@
<update version="3">
<install>
<file>
<source>sourceOne</source>
<dest>destOne</dest>
<mode>0777</mode>
</file>
<file>
<source>MultiMC.exe</source>
<dest>M/u/l/t/i/M/C/e/x/e</dest>
<mode>0644</mode>
</file>
</install>
<uninstall>
<file>toDelete.abc</file>
</uninstall>
</update>