OLD | NEW |
1 import unittest | 1 import unittest |
2 import sys | 2 import sys |
3 import os | 3 import os |
4 import commands | 4 import commands |
5 import re | 5 import re |
6 | 6 |
7 from bake.ModuleEnvironment import ModuleEnvironment | 7 from bake.ModuleEnvironment import ModuleEnvironment |
8 from bake.ModuleLogger import StdoutModuleLogger | 8 from bake.ModuleLogger import StdoutModuleLogger |
9 from bake.Exceptions import TaskError | 9 from bake.Exceptions import TaskError |
10 | 10 |
(...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
860 testResult = git.download(self._env) | 860 testResult = git.download(self._env) |
861 | 861 |
862 # None means everything was OK, since there were no exceptions | 862 # None means everything was OK, since there were no exceptions |
863 self.assertEqual(testResult, None) | 863 self.assertEqual(testResult, None) |
864 ········ | 864 ········ |
865 # will use the README file to see if the update works | 865 # will use the README file to see if the update works |
866 testStatus = commands.getoutput('cd /tmp/hello-world; git log') | 866 testStatus = commands.getoutput('cd /tmp/hello-world; git log') |
867 lastVersion = re.compile(' +\w+').search(testStatus).group().replace(" "
,"") | 867 lastVersion = re.compile(' +\w+').search(testStatus).group().replace(" "
,"") |
868 self.assertEqual(lastVersion, "78cfc43c2827b9e48e6586a3523ff845a6378889"
) | 868 self.assertEqual(lastVersion, "78cfc43c2827b9e48e6586a3523ff845a6378889"
) |
869 | 869 |
| 870 testResult = git.update(self._env)······· |
| 871 self.assertEqual(testResult, None) |
| 872 |
| 873 git.attribute("revision").value="45021a874e090b765acc5e2696154c495686614
b" |
| 874 testResult = git.update(self._env)······· |
| 875 self.assertEqual(testResult, None) |
| 876 |
| 877 commands.getoutput("cat /tmp/hello-world/c.c >> /tmp/hello-world/dos.bat
") |
| 878 testResult = git.update(self._env)······· |
| 879 self.assertEqual(testResult, None) |
| 880 |
870 #after the test, clean the environment | 881 #after the test, clean the environment |
871 self.execute_command(["rm", "-rf", "hello-world"], "/tmp") | 882 self.execute_command(["rm", "-rf", "hello-world"], "/tmp") |
872 ······ | 883 ······ |
873 # download a specific version | 884 # download a specific version |
874 git.attribute("revision").value="3fa7c46d11b11d61f1cbadc6888be5d0eae2196
9" | 885 git.attribute("revision").value="3fa7c46d11b11d61f1cbadc6888be5d0eae2196
9" |
875 testResult = git.download(self._env)······· | 886 testResult = git.download(self._env)······· |
876 self.assertEqual(testResult, None) | 887 self.assertEqual(testResult, None) |
877 ········ | 888 ········ |
878 # verify that the version is the correct one | 889 # verify that the version is the correct one |
879 testStatus = commands.getoutput('cd /tmp/hello-world; git log') | 890 testStatus = commands.getoutput('cd /tmp/hello-world; git log') |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
976 | 987 |
977 | 988 |
978 # TODO:· | 989 # TODO:· |
979 # Tests for CvsModuleSource | 990 # Tests for CvsModuleSource |
980 # GitModuleSource | 991 # GitModuleSource |
981 # InlineModuleSource (?!?!?!) | 992 # InlineModuleSource (?!?!?!) |
982 | 993 |
983 # main call for the tests········ | 994 # main call for the tests········ |
984 if __name__ == '__main__': | 995 if __name__ == '__main__': |
985 unittest.main() | 996 unittest.main() |
OLD | NEW |