Пример #1
0
    def test_repository_analysis(self):
        # Set options
        import sys
        from io import StringIO
        from gitinspector.gitinspector import main

        # Setting a fake sys.argv and sys.stdout
        argv_orig = sys.argv
        stdout_orig = sys.stdout
        sys.stdout = custom_stdout = StringIO()

        # Extracting the repository
        zip_ref = zipfile.ZipFile("tests/resources/basic-repository.zip", 'r')
        zip_ref.extractall("build/tests")
        zip_ref.close()

        # Running the software
        sys.argv = ['gitinspector.py', 'build/tests/basic-repository']
        main()
        self.assertTrue(sys.stdout)

        # Restoring the original context
        sys.argv = argv_orig
        sys.stdout.close()
        sys.stdout = stdout_orig
        shutil.rmtree("build/tests/basic-repository")
Пример #2
0
    def test_version(self):
        # Set options
        import sys
        from io import StringIO
        from gitinspector.gitinspector import main

        # Setting a fake sys.argv and ssys.stdout
        argv_orig = sys.argv
        stdout_orig = sys.stdout
        sys.stdout = custom_stdout = StringIO()

        # Running the software on '--version'
        sys.argv = ['./gitinspector.py', '--version']
        try:
            main()
        except SystemExit:
            self.assertTrue(sys.stdout)

        # Restoring the original context
        sys.argv = argv_orig
        sys.stdout.close()
        sys.stdout = stdout_orig
Пример #3
0
#!/usr/bin/env python
# coding: utf-8
#
# Copyright © 2015 Ejwa Software. All rights reserved.
#
# This file is part of gitinspector.
#
# gitinspector is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# gitinspector is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with gitinspector. If not, see <http://www.gnu.org/licenses/>.

from gitinspector import gitinspector

if __name__ == "__main__":
	gitinspector.main()
Пример #4
0
#!/usr/bin/env python
# coding: utf-8
#
# Copyright © 2015 Ejwa Software. All rights reserved.
#
# This file is part of gitinspector.
#
# gitinspector is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# gitinspector is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with gitinspector. If not, see <http://www.gnu.org/licenses/>.

from gitinspector import gitinspector

if __name__ == "__main__":
    gitinspector.main()